Stop destructive updates to path in setPath#808
Merged
jdmarshall merged 2 commits intonode-config:masterfrom May 28, 2025
Merged
Stop destructive updates to path in setPath#808jdmarshall merged 2 commits intonode-config:masterfrom
jdmarshall merged 2 commits intonode-config:masterfrom
Conversation
Collaborator
Author
|
Okay, I have the big PR queued up and it would be a bit smaller if this one landed. |
Collaborator
Author
|
Note: this is a little slower, but the slowdown is proportional to the key depth, which for config is usually pretty short. Local benchmark: shift is about 6 times faster than slice with an array of 100k entries, but only twice as fast for an array of 10k entries. Meanwhile we are more likely to be doing lookups of depth 5-8. |
Collaborator
Author
|
I have 2 PRs open at the moment and they're a lot. I will file a PR to make this function iterative after those land and that will make this function a lot simpler to trace and remove the slice() calls. |
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.
Simplify setModuleDefaults and getImpl/setPath to getPath/setPath
I believe I have finally cracked how to split up lib/config.js
This is some low-hanging fruit that simplifies the rest.