branchrust_reboot/main/growablegenes_allocscancel
10 Commits over 92 Days - 0.00cph!
Clean: remove unused static
Tests: none, trivial change
Clean: unused usings
Tests: none, trivial change
Merge: from main
Tests: editor builds
Clean: remove Sort from BufferList
Not used anywhere
Tests: editor builds
Optim: don't sort slotWeights to avoid internal allocs
Array.Sort(T[], IComparer<T>) in this version of mono always allocates a Comparison<T> internally. Lucky for us, we can just simplify the code and avoid this alloc.
Tests: alloc unit test passes
Optim: avoid allocating compoarison delegate in GrowableGenes.PickWeightedGeneType
Tests: unit test
Test: GrowableGenes test to track allocations
- only tests GrowableGenes.GenerateRandom, but that was enough of a head-ache
Found one opportunity to get rid of garbage alloc, but also found out Array.Sort(T[], int, int, ICompare<T>) always allocates
Tests: ran the unit test
Clean: remove profiling hack
Tests: none, trivial change
Update: avoid linq allocations in GrowableGenes
Tests: local in editor, spawned a planter box, filled it with seeds while monitoring Profiler stream