Repository navigation
Conversation
- Keep `hashNodes` in a Map and register only nodes with a custom hash. The default hash is the node id, so such a node can only ever find itself. - Cache the hashes of the property names used by `Node.getCacheKey()`. - Give the per node data a stable shape and read it once in `getDataFromNode()`. - Iterate node properties without `Object.values()` and track the finished build stages as bits instead of an object per node and stage. The generated shaders are unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
📦 Bundle sizeFull ESM build including core, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Collaborator
|
These are still too many changes at once. And I doubt all of them make sense. Stuff like How about just doing the following in
|
kvnloo
added a commit
to kvnloo/three.js
that referenced
this pull request
Nov 10, 2026
Scope mrdoob#35441 by Makio64 to Mugen87's requested hashNodes Map and stable nodeData shape; retain fork dev Node build and scheduling semantics. Exercise numeric/string/special hashes and four-stage data shape. Browser tests and shaders not executed. Prepared downstream for Kevin's OSS factory; no upstream publication.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #35436
Description
Less bookkeeping per node in
Node.build()andNodeBuilder. The generated WGSL is identical for all 21 test materials.hashNodesis aMapand only holds nodes with a customgetHash(). The default hash is the node id, so such a node can only find itself.getCacheKey()caches the hash of each property name.getDataFromNode().Object.values(), and the finished build stages are bits instead of an object per node and stage.WGSLNodeBuilder.build()devMeshBasicNodeMaterialMeshStandardNodeMaterial, 5 lightsMeshStandardNodeMaterial, 5 lights, shadowsMeshPhysicalNodeMaterial, all featuresCPU time in Node 24 on an Apple M3 Max, best of 4 interleaved runs of 16 builds each.
🤖 Generated with Claude Code