fs: ES6 Spread Operator for extended parameter handling#17486
fs: ES6 Spread Operator for extended parameter handling#17486mithunsasidharan wants to merge 1 commit intonodejs:masterfrom mithunsasidharan:spread_operator
Conversation
|
These sort of changes need benchmarks - have you tried running the benchmarks and getting results? |
apapirovski
left a comment
There was a problem hiding this comment.
I'm sorry but I'm strongly -1 on this change. This will be much slower than using apply is.
|
@apapirovski : Thanks for the feedback. I'll close the PR. |
|
@apapirovski would still love some benchmarks |
|
@benjamingr I'm speaking from experience after trying to make this change on |
|
@apapirovski : Thanks for sharing that. Quite helpful 👍 |
|
@apapirovski can you send me a link to those benchmarks then? This is the third time we've been talking about whether or not spread is optimized or not and I want something concrete to go with when I bug V8 people about it :) |
|
@benjamingr the benchmarks are just the events ones... I think I saw the issue when working on |
|
I wish I had more info, it's just that I've been working on that stuff on-and-off for the past 2 months so it's a bit hard to recall at what point I encountered it. You could look over recent events, timers & process PRs potentially. |
|
@apapirovski @benjamingr : Just to mention, post closing the PR.. over my conversation with few JS experienced dev folks.. they did acknowledge too that |
|
ping @bmeurer any thoughts on |
|
FWIW I think the fastest combination here might be When I test that version within @mithunsasidharan If you would like to try that version of the PR and run the relevant benchmarks in Here's the bench results after a short run: Reasonably certain it's faster. Don't think it can land on v8.x or older though. |
|
Also, you could potentially test |
|
@apapirovski : Can you take a look at updated change here ? |
lib/fs.js
Outdated
There was a problem hiding this comment.
This should be ...args to match the variable below.
lib/fs.js
Outdated
There was a problem hiding this comment.
On that note, could we change this to Reflect.apply(cb, undefined, args);? Thank you! That will mean we no longer depend on the user provided apply.
There was a problem hiding this comment.
@apapirovski : Please take a look now. Thanks !
|
@apapirovski Yes I also think |
apapirovski
left a comment
There was a problem hiding this comment.
LGTM if CI & benchmark CI are happy.
|
@apapirovski : Thanks much ! |
|
LGTM |
|
Landed in 0a0fbd5 |
PR-URL: #17486 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
PR-URL: #17486 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
PR-URL: #17486 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Replaced
f.apply(undefined, arguments)to ES 6f(...arguments)Extended Parameter Handling Spread Operator inlib/fs.jsChecklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
fs