Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion / Idea  ObiUpdater needlessly allocates every frame
#4
The allocations required for the job handles returned by BeginStep and Substep are kinda "annoying". They return a new class instance every time (BurstJobHandle in the case of the Burst backend), and I see this is conceptually necessary because there are two backends and the shared interface IObiJobHandle is used. However, both those classes are so simple that I don't think this deserves an allocation each and every frame.

For my project, I added a pool for the burst job handles now, which I release before the Clear that @timconkling added. This gets rid of regular allocations and does not need much refactoring (I added a Release method to the IObiJobHandle interface). Something like this should definitely be adopted in Obi.

With this change and the others I proposed (http://obi.virtualmethodstudio.com/forum...-3251.html and http://obi.virtualmethodstudio.com/forum...-3250.html), I seem to be down to zero per-frame GC allocations for Obi.
Reply


Messages In This Thread
RE: ObiUpdater needlessly allocates every frame - by pdinklag - 28-12-2021, 11:05 AM