| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
@mscdex sadly an error occured when I tried to trigger a build :( |
Sorry, something went wrong.
There was a problem hiding this comment.
These were changed to match those found in the other breadth benchmarks and it also seems to provide more stable results.
Sorry, something went wrong.
There was a problem hiding this comment.
The fact that we’re emitting one object on init and then pushing another on the next tick queue goes against basic expectations of using async hooks and what the resource is supposed to represent.
Sorry, something went wrong.
|
Since there are some that believe this should be semver-major, ping @nodejs/tsc |
Sorry, something went wrong.
|
ping? |
Sorry, something went wrong.
|
In the context of exposing the current async resource rather than just exposing the asyncId, this change might require to be reverted/changed later. However that work is not settled yet, so we might want to land this anyway, as this code is not really ready for it yet. As an example, we are pursuing this change: #25094 for that reason. cc @nodejs/diagnostics |
Sorry, something went wrong.
|
ping @nodejs/tsc once more |
Sorry, something went wrong.
|
There probably won't be a meeting this week, but I'm going to throw a tsc-agenda label on this to make sure it doesn't entirely fall off the TSC radar for a third time. |
Sorry, something went wrong.
|
(Obviously, if resolution is achieved before the next TSC meeting, that's awesome and I'll be delighted to remove the label at that time.) |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for working on nextTick! I've got some questions.
I'm failing to understand why this changes improves performance, and if it may something related to our benchmarks.
Have you tried if moving just the emitInit call outside of the constructor generates the same result?
Have you verified that is using the same object for both emitInit and queue.push() is what is actually creating the performance improvements?
@mscdex have you experiences this improves things in a more realistic scenario including I/O?
Also cc @bmeurer who might provide some insights.
Sorry, something went wrong.
@mcollina I honestly don't remember now, I tried a lot of variations though at the time, and this was the only one that resulted in a positive improvement with no regressions. |
Sorry, something went wrong.
|
The change looks reasonable to me (JavaScript wise), but I'm really not a good candidate to review this, since this is not my area of expertise. |
Sorry, something went wrong.
|
@bmeurer have you got a clue on why this is faster than the current one? |
Sorry, something went wrong.
As far as I can tell, this should be mostly related to using symbols which are in my experience slower for both getting and setting properties (and for your version the fact that we use an if condition rather than just running the emitInit function). That said, happy to be corrected. |
Sorry, something went wrong.
|
Ping @mscdex |
Sorry, something went wrong.
|
I've made different changes now to avoid the issues with domain. The new benchmark results are: confidence improvement accuracy (*) (**) (***) process/next-tick-breadth-args.js n=10000000 *** 17.11 % ±2.80% ±3.74% ±4.89% process/next-tick-breadth.js n=10000000 *** 40.88 % ±2.72% ±3.62% ±4.71% process/next-tick-depth-args.js n=7000000 *** 21.87 % ±2.18% ±2.92% ±3.82% process/next-tick-depth.js n=7000000 *** 23.58 % ±7.60% ±10.12% ±13.17% process/next-tick-exec-args.js n=4000000 *** 39.07 % ±1.88% ±2.51% ±3.28% process/next-tick-exec.js n=4000000 *** 44.92 % ±1.67% ±2.23% ±2.91% |
Sorry, something went wrong.
|
/cc @nodejs/collaborators |
Sorry, something went wrong.
|
@mscdex does it still fail the test in #25461 (comment)? Maybe we should add it to our suite. |
Sorry, something went wrong.
|
@mcollina It should not fail it because the same object is being used now. These changes are now more or less inlining the previous custom TickObject class constructor code. |
Sorry, something went wrong.
|
Would you mind adding that test to this PR? Code LGTM. |
Sorry, something went wrong.
|
@mcollina Honestly I think that's probably best left to a separate issue/PR about whether we should (explicitly) support modifying behavior like that from an async hook callback. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
Not sure - how much of the improvement is accounted for by this alone (and not the other part of this CL)?
Glancing at e.g. next-tick-depth-args, it doesn't look like the arguments to the callbacks are ever used - maybe we optimize something there. We don't do analysis like that for spread calls
Sorry, something went wrong.
There was a problem hiding this comment.
@psmarshall the reason I was concerned is that we removed this optimization from certain parts of the code before.
Sorry, something went wrong.
There was a problem hiding this comment.
I think it's possible to construct a microbenchmark where one or the other is faster - I don't think you could measure the difference on a larger application that does a lot of work between ticks. With that in mind my preference is for the spread-call version but I also don't really have the time to do a detailed analysis of what's going on in this specific case so I'm fine either way.
Sorry, something went wrong.
Making `.incRef()` and `.decRef()` fail silently leads to better error messages when trying to access the underlying value (as opposed to crashing inside these methods). Refs: #25461 (comment) PR-URL: #29289 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gus Caplan <me@gus.host>
PR-URL: #25461 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Making `.incRef()` and `.decRef()` fail silently leads to better error messages when trying to access the underlying value (as opposed to crashing inside these methods). Refs: #25461 (comment) PR-URL: #29289 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gus Caplan <me@gus.host>
PR-URL: #25461 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Making `.incRef()` and `.decRef()` fail silently leads to better error messages when trying to access the underlying value (as opposed to crashing inside these methods). Refs: #25461 (comment) PR-URL: #29289 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Gus Caplan <me@gus.host>
| Back | FazBrowse Home | New Git URL |
Checklist