Uh oh!
There was an error while loading. Please reload this page.
Pass args to process.nextTick() - #1077
Conversation
0d1d754 to
5e34baeCompareThere was a problem hiding this comment.
Any chance of figuring this out before merging?
There was a problem hiding this comment.
I will. Just don't have the brain cells at the moment to figure out why process.nextTick() returns undefined in the mentioned test.
There was a problem hiding this comment.
I just tested this and all tests (including test-repl-timeout-throw) still pass after changing this additional instance of process.nextTick() to process.nextTick(afterWrite, stream, state, finished, cb);
There was a problem hiding this comment.
Thanks. I'll make the change to the PR.
rvagg
commented
Mar 5, 2015
this is a tiny bit gross and a quite a leaky abstraction, I'm not really a fan of exposing ugly APIs just because it's the fastest way--fine if it's an internal API for the sake of cleaning up and speeding up (does it really do either of those?) but now we have to expose this to users.
|
trevnorris
commented
Mar 5, 2015
@rvagg leaky? and it does both clean up and speed up (removing the need for additional function closures, flatten function declarations and no need to create an actual array). I played with the other API decision, but it causes far too many DEOPTs in |
rvagg
commented
Mar 5, 2015
leaky abstraction in the sense that your abstraction is saying too much about the implementation -- you're declaring to the world that you had to make compromises on your API to get other outcomes (performance), there has to be a tradeoff between pure perf and the best internal implementation and the API we expose to users and I'm here representing the API and this is that tradeoff discussion |
piscisaureus
commented
Mar 5, 2015
I agree with @rvagg. This adds API that may seem nice and fast now but we have to support it forever. It would be more helpful if the setArgs api was strictly internal. |
cjihrig
commented
Mar 5, 2015
@piscisaureus as in |
tellnes
commented
Mar 6, 2015
I also agree with @rvagg on this. If we do need an ugly API, then let us try to find a way to not expose it. |
vkurchatkin
commented
Mar 6, 2015
+1 on making this internal. See discussion in #953 |
medikoo
commented
Mar 6, 2015
This is quite dirty design, totally not common to similar API's, that people are familiar with. |
5e34bae to
8828d49Comparetrevnorris
commented
Mar 6, 2015
@medikoo I don't appreciate "dirty design". Yes it's uncommon, but in terms of code complexity and performance it's the cleanest.
|
vkurchatkin
commented
Mar 6, 2015
sigh one more "private" thing that people will use |
trevnorris
commented
Mar 6, 2015
@vkurchatkin I figured the fact that using |
rvagg
commented
Mar 6, 2015
I echo your sigh here, could we make use of |
trevnorris
commented
Mar 6, 2015
@rvagg unless we're willing to either 1) remove |
vkurchatkin
commented
Mar 6, 2015
we can have this without internal modules @trevnorris I'm thinking about 2: user facing one would be just a wrapper of internal one |
There was a problem hiding this comment.
This may prove problematic for porting it to readable-stream, since it's using an API that browserify (almost certainly) does not support.
chrisdickinson
commented
Mar 10, 2015
If we end up going this route, I'm in favor of going the internal module + private symbol approach for solving this so we don't expose the (This is also a fairly precarious change for readable-stream, no matter which way the flow of code goes. Either way, it may not have access to |
vkurchatkin
commented
Mar 10, 2015
@chrisdickinson I propose injecting private |
chrisdickinson
commented
Mar 10, 2015
@vkurchatkin Then we have two |
vkurchatkin
commented
Mar 10, 2015
@chrisdickinson What I mean is something like this: |
sam-github
commented
Mar 11, 2015
@trevnorris can you comment on why this API is faster than ? I assume it was because you don't want to slice fn off the start of |
chrisdickinson
commented
Mar 11, 2015
@vkurchatkin How does that private |
vkurchatkin
commented
Mar 11, 2015
it is passed as an argument to module wrapper. Not a good idea for |
sam-github
commented
Mar 11, 2015
Oh, and if nextTick is worth making better for use in iojs, its worth making it better for everybody, IMHO. |
trevnorris
commented
Mar 11, 2015
@sam-github It makes the call to |
trevnorris
commented
Mar 11, 2015
I won't accept |
chrisdickinson
commented
Mar 13, 2015
Just thinking through this out loud, with regards to readable streams: even with an exposed |
sam-github
commented
Mar 17, 2015
@trevnorris thanks, I get it. It is unfortunately ugly... but that might limit its use to just performance-critical code... which would be OK. Is megamorphic even a word? :-) |
petkaantonov
commented
Mar 27, 2015
This could be also merged right now as an unobservable change (with the doc changes reverted) and make the public API "release" later in a semver-minor. |
trevnorris
commented
Mar 27, 2015
Thanks @petkaantonov. That would be my preference. |
Fishrock123
commented
Apr 8, 2015
@trevnorris done any benchmarks yet? I see that was the resolution as of the tc-meeting it was discussed in. |
trevnorris
commented
Apr 8, 2015
@Fishrock123 some. Initial results showed improvements just above the margin of error. Part of the gain also comes from easier performance debugging, since functions won't DEOPT from being scoped. It's possible to create a benchmark that shows significant gains, but this is definitely a micro optimization. |
trevnorris
commented
Apr 15, 2015
@iojs/tc Was this supposed to have landed before the 1.7 release? |
cjihrig
commented
Apr 15, 2015
LGTM. Starting CI to verify. |
cjihrig
commented
Apr 15, 2015
PR-URL: #1077 Reviewed-by: Colin Ihrig <cjihrig@gmail.com>
trevnorris
commented
Apr 15, 2015
Thanks. Landed in 10e31ba. |
jbergstroem
commented
Apr 16, 2015
Possibly stupid question, but seeing this is server-minor - is 1.8.0 our next release? |
rvagg
commented
Apr 16, 2015
@jbergstroem yes, either that or 2.0.0 if we get the https://github.com/iojs/io.js/milestones/2.0.0 changes sorted out |
trevnorris
commented
Apr 16, 2015
@jbergstroem this should have been merged before 1.7 but wasn't. |
jbergstroem
commented
Apr 16, 2015
Ok. I was pretty keen on getting 1.7.2 within a week or so with a fix to a shared build. Guessing 2.0 might make that easier since we'd branch off to master/1.x/2.x? |
Notable Changes: * build: Support for building io.js as a static library (Marat Abdullin) #1341 * deps: upgrade openssl to 1.0.2a (Shigeki Ohtsu) #1389 * npm: Upgrade npm to 2.8.3. (Forrest L Norvell) #1448 * src: allow multiple arguments to be passed to process.nextTick (Trevor Norris) #1077 * module: interaction of require('.') with NODE_PATH has been restored and deprecated. This functionality will be removed at a later point. (Roman Reiss) #1363
Notable Changes: * build: Support for building io.js as a static library (Marat Abdullin) #1341 * deps: upgrade openssl to 1.0.2a (Shigeki Ohtsu) #1389 * npm: Upgrade npm to 2.8.3. (Forrest L Norvell) #1448 * src: allow multiple arguments to be passed to process.nextTick (Trevor Norris) #1077 * module: the interaction of require('.') with NODE_PATH has been restored and deprecated. This functionality will be removed at a later point. (Roman Reiss) #1363
19h
commented
Apr 18, 2015
🎉 🎉 Awesome! 🎉 🎉 |
Notable Changes: * build: revert vcbuild.bat changes * changes inherited from v1.8.0: * build: Support for building io.js as a static library (Marat Abdullin) #1341 * npm: Upgrade npm to 2.8.3. (Forrest L Norvell) #1448 * deps: upgrade openssl to 1.0.2a (Shigeki Ohtsu) #1389 * src: allow multiple arguments to be passed to process.nextTick (Trevor Norris) #1077 * module: the interaction of require('.') with NODE_PATH has been restored and deprecated. This functionality will be removed at a later point. (Roman Reiss) #1363
igl
commented
Apr 23, 2015
Since nobody mentioned it: Isn't |
petkaantonov
commented
Apr 23, 2015
@igl Yes, well only that, it's like 100000x slower. |
Now allow
process.nextTick(callback[, ... vargs])R=@bnoordhuis