Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion / Idea  Per-Frame GC Allocation in Burst Solver
#1
While profiling, I hit on a pretty obvious per-frame GC allocations in the Burst Solver: the padding array in BurstSolverImpl.ApplyConstraints.

The allocation can be avoided by using a stack-allocated span, the number of enum entries is small enough:
Code:
Span<int> padding = stackalloc int[Oni.ConstraintTypeCount];

However, I'm not sure since when exactly Unity supports C# 7.2, so for older versions, a statically allocated array might be due.
Reply


Messages In This Thread
Per-Frame GC Allocation in Burst Solver - by pdinklag - 28-12-2021, 10:39 AM