Commit dbad1d4
NodeMaterialObserver: Reuse
`getLights` allocated a fresh `{ renderId, lightsData }` object every
time `renderId` changed (i.e. once per frame per lightsNode). Mutate
the cached entry's fields in place instead, so the cache-miss path
doesn't allocate after the first frame.
`getLightsData` also allocated a fresh `const lights = []` per call;
change the signature to accept the output array so it can be reused.
Measured on webgpu_backdrop_water (Inspector stripped, 1 KB sampling):
site no longer appears in the top 30 allocators.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>lightsData cache entry per frame.1 parent 2e164b2 commit dbad1d4
1 file changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
632 | | - | |
| 632 | + | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
661 | | - | |
| 661 | + | |
662 | 662 | | |
663 | | - | |
| 663 | + | |
664 | 664 | | |
665 | | - | |
| 665 | + | |
666 | 666 | | |
667 | | - | |
| 667 | + | |
668 | 668 | | |
669 | | - | |
| 669 | + | |
670 | 670 | | |
671 | | - | |
| 671 | + | |
| 672 | + | |
672 | 673 | | |
673 | | - | |
| 674 | + | |
674 | 675 | | |
675 | | - | |
| 676 | + | |
| 677 | + | |
676 | 678 | | |
677 | | - | |
| 679 | + | |
678 | 680 | | |
679 | 681 | | |
680 | 682 | | |
| |||
0 commit comments