Skip to content

WebGPURenderer: Introduce hash-based cache key#29479

Merged
sunag merged 8 commits into
mrdoob:devfrom
sunag:dev-numeric-hash
Sep 25, 2024
Merged

WebGPURenderer: Introduce hash-based cache key#29479
sunag merged 8 commits into
mrdoob:devfrom
sunag:dev-numeric-hash

Conversation

@sunag
Copy link
Copy Markdown
Collaborator

@sunag sunag commented Sep 24, 2024

Related issue: #29386, #29212 (comment)

Description

A numeric cache key brings a performance gain in the rendering cycle ( #29386 ) in addition to saving memory because it is just an integer instead of sometimes big strings.

As RenderObjects hashes inherited the individuality of RenderContext, the possibility of collision decreases, among other detail that can be improved in case of we encounter any collision issues.

I was thinking about using the getHash terminology but I had some conflicts with some existing functions.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 24, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 687.32
170.19
687.32
170.19
+0 B
+0 B
WebGPU 836.4
224.22
836.83
224.44
+422 B
+224 B
WebGPU Nodes 835.91
224.09
836.34
224.32
+422 B
+224 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 463.24
111.86
463.24
111.86
+0 B
+0 B
WebGPU 532.82
143.71
533.19
143.85
+377 B
+142 B
WebGPU Nodes 489.16
133.47
489.54
133.61
+377 B
+139 B

Comment thread src/renderers/common/nodes/Nodes.js Fixed
Comment thread src/nodes/lighting/AnalyticLightNode.js Fixed
@sunag sunag marked this pull request as ready for review September 24, 2024 03:07
@sunag sunag added this to the r169 milestone Sep 24, 2024
@sunag sunag changed the title WebGPURenderer: Introduce numeric cache key WebGPURenderer: Introduce hash-based cache key Sep 24, 2024
@sunag sunag merged commit 52f640d into mrdoob:dev Sep 25, 2024
@sunag sunag deleted the dev-numeric-hash branch September 25, 2024 02:15
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.

2 participants