Skip to content

WebGPURenderer: Optimize chain key array reset.#32833

Merged
Mugen87 merged 1 commit intomrdoob:devfrom
Mugen87:dev2
Jan 23, 2026
Merged

WebGPURenderer: Optimize chain key array reset.#32833
Mugen87 merged 1 commit intomrdoob:devfrom
Mugen87:dev2

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jan 23, 2026

Related issue: #32675

Description

The PR adapts the approach for resetting the chain key array of RenderObjects.get() to other places of WebGPURenderer. Instead of setting the array's length property to 0 which triggers a resize, the key entries are set to null instead. This actually improves performance a bit since the length of the array is kept static. In the performance stress test of #32675, I get around 0.5%-0.75% less CPU load (monitored with Chrome Task Manager). That doesn't sound like much but even minor optimizations can accumulate^^.

@Mugen87 Mugen87 changed the title WebGPURenderer: Optimize chain key arrays. WebGPURenderer: Optimize chain key array reset. Jan 23, 2026
@Mugen87 Mugen87 added this to the r183 milestone Jan 23, 2026
@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 357.49
84.84
357.49
84.84
+0 B
+0 B
WebGPU 622.1
172.82
622.14
172.83
+40 B
+14 B
WebGPU Nodes 620.7
172.58
620.74
172.59
+40 B
+14 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 490.27
119.86
490.27
119.86
+0 B
+0 B
WebGPU 693.07
188.09
693.11
188.11
+40 B
+13 B
WebGPU Nodes 642.46
175.2
642.5
175.21
+40 B
+9 B

@Mugen87 Mugen87 merged commit dcb73dd into mrdoob:dev Jan 23, 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.

1 participant