ebiten/internal/packing
divVerent 574925cf7a
packing: remove redundant canAlloc checking and alloc allocating. (#2629)
By removing redundant work done in canAlloc and just calling alloc right away,
this removes 35% contribution to AAAAXY loading CPU time on the profile on
https://user-images.githubusercontent.com/251568/230496805-c5e32c19-9258-49c8-800b-a3f0bc3b072d.svg,
or - as measured via stopwatch - brings loading time on Moto G7 Play from
17.22s to 14.94s after already applying #2627.

This should be safe as there is no case in which alloc succeeds and the
allocated region isn't used; also, there is no case in which alloc mutates the
tree when it doesn't actually succeed (comment added in one place to justify
this).

Closes #2628
2023-04-08 22:03:16 +09:00
..
packing_test.go internal/packing: bug fix: node's links were not synced correctly 2023-02-28 20:31:39 +09:00
packing.go packing: remove redundant canAlloc checking and alloc allocating. (#2629) 2023-04-08 22:03:16 +09:00