Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion / Idea  ObiUpdater needlessly allocates every frame
#5
(28-12-2021, 11:05 AM)pdinklag Wrote: 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.

Hi pdinklag,

Thanks a lot for your reports/contributions! This one and the allocation in Decimate() will certainly make their way onto Obi's codebase.

Keep an eye for them in Obi 6.3.1.
Reply


Messages In This Thread
RE: ObiUpdater needlessly allocates every frame - by josemendez - 10-01-2022, 10:37 AM