-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
path: change path.join
to use array dynamic allocation
#54397
Conversation
Change path.join to use array dynamic allocation instead of push. Refs: nodejs#54331
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1606/
|
I the benchmark results you shared can be generalized, we should probably replace all instances of |
Why would we do that? |
If we don't care about prototype pollution, |
I agree with you. I think this could be a solution for those who are worried about prototype pollution and those who are focusing on performance, although other points will need to check more. This is because there is no significant difference in performance from |
But:
|
Just as much as |
My point is that it doesn't have better performance than |
I don't disagree with your point. Let me try to better explain my perspective:
My point is that we should use |
Are you sure that |
Change
path.join
to use array dynamic allocation instead of push.Refs: #54331