GLTFLoader: loadNode() dependency request optimization #25079
Merged
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: #25058 (comment)
Description
Currently
loadNode()
first requests the object dependencies for a node, and then it requests skin dependency whey the object dependencies are resolved, and then requests child node dependencies when the skin dependency is resolved. This chain can be long and the response time from the loader can be long. (The problem has been originally mentioned at #15587 (comment))This PR optimizes the dependency requests in
loadNode()
. Start all the dependency requests for a node at the beginning ofloadNode()
. Shorter response time can be expected because of the better use of download parallelism.Note: This change doesn't have an effect to Three.js scene graph order.
Additional context
Honestly I don't have a test glTF asset. I'd be happy if someone would test and check how much this change can improve the response time.