Skip to content

NodeMaterialObserver: Avoid usage of Object.keys().#33113

Merged
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2
Mar 3, 2026
Merged

NodeMaterialObserver: Avoid usage of Object.keys().#33113
Mugen87 merged 1 commit into
mrdoob:devfrom
Mugen87:dev2

Conversation

@Mugen87
Copy link
Copy Markdown
Collaborator

@Mugen87 Mugen87 commented Mar 3, 2026

Fixed #33107.

Description

The PR is an alternative to #33111 with a more simple and less invasive approach. Object.keys() in equals() is replaced with for...in loops which avoids any object allocations during the attribute comparison process.

@Mugen87 Mugen87 added this to the r184 milestone Mar 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 359.27
85.31
359.27
85.31
+0 B
+0 B
WebGPU 629.94
174.99
629.93
174.99
-11 B
+0 B
WebGPU Nodes 628.52
174.74
628.51
174.74
-11 B
+1 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 491.03
119.72
491.03
119.72
+0 B
+0 B
WebGPU 703.56
189.99
703.55
189.99
-11 B
+1 B
WebGPU Nodes 652.77
177.37
652.76
177.37
-11 B
+2 B

@Mugen87 Mugen87 merged commit 051fbfd into mrdoob:dev Mar 3, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Renderer._renderObjectDirect(): 4x object allocation per mesh per render GC pressure/jank

1 participant