| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
The total list of issues found:
I'm not sure if fixing most of those matters, but at least some should be fixed imo. |
Sorry, something went wrong.
|
If I get time, I'll run IRHydra against my patch and see what comes out. That would be the best first step, to compare the actual compiled result. |
Sorry, something went wrong.
There was a problem hiding this comment.
Perhaps specifying the length up front, var paths = new Array(arguments.length); and assigning at the index would be faster?
Sorry, something went wrong.
There was a problem hiding this comment.
@brendanashworth Done.
Sorry, something went wrong.
|
A while back, we had support for macro expansion in our native modules. If this is proving to be a generally viable speedup, it would be nice to put it in macro form so that it's easy to rip out again if V8 changes things. |
Sorry, something went wrong.
There was a problem hiding this comment.
There's another obvious performance optimization here: cache the result of require('assert'). :-)
Sorry, something went wrong.
|
A comment and a question:
|
Sorry, something went wrong.
|
2: Iirc last time we checked const is still slower than var. |
Sorry, something went wrong.
|
If you're referring to the OSR issue, I think I only saw that with let, not const. Also, it was a while ago, it would be good to retest. |
Sorry, something went wrong.
|
this jsperf shows that const is faster than var right now |
Sorry, something went wrong.
|
@Fishrock123, @bnoordhuis Compound assignment deoptimizes let: let x = 10; x += 1; is slow in both 4.2 and 4.3, but let x = 10; x = x + 1; is fine. This shouldn't be an issue for const because you don't want compound assigments with const =). |
Sorry, something went wrong.
|
@bnoordhuis Done:
|
Sorry, something went wrong.
|
@brendanashworth Ow. That jsperf shows that var is faster than const right in Chromium 43. |
Sorry, something went wrong.
|
We should probably move to preferring const (where correct/possible) in all new patches then. |
Sorry, something went wrong.
|
LGTM |
Sorry, something went wrong.
|
Should I patch other places from #1752 (comment) ? |
Sorry, something went wrong.
|
The let performance patch landed in v8 4.4.30. |
Sorry, something went wrong.
|
I'd be a lot more comfortable with this if it were reintroduced as a macro. It'd be a lot easier to document / spread knowledge about its use, as well as to back out of it if perf characteristics change. |
Sorry, something went wrong.
|
@chrisdickinson This is a temporary solution anyways. Related: https://code.google.com/p/v8/issues/detail?id=2159 A macro (and documenting it) seems like a bit undue for a temporary hack. |
Sorry, something went wrong.
|
@ChALkeR In my experience rest params are already almost on par with using arguments. It's the spread operator that will eat your face. |
Sorry, something went wrong.
|
@trevnorris arguments is not an array, also it introduces a deopt if you do anything to it except taking arguments.length (in fact this also should be done carefully) and accessing arguments[i] where 0 <= i < arguments.length. This is why manually copying arguments to an array and passing that array is faster than passing the arguments object. «On par with arguments» is not good enough. Afaik, rest params are deoptimized (or, rather, not yet optimized) for now. Also, I am not sure what is the v8 version requirements for them to work without issues. And they are behind a flag. See https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments. |
Sorry, something went wrong.
|
@ChALkeR I'm aware of all that. Was just stating that rest params being well optimized isn't far off. |
Sorry, something went wrong.
|
@trevnorris Yes. And that's why I don't see an advantage in hacking this with something more complex, as macro (and documenting it), as @chrisdickinson proposed here: #1752 (comment) |
Sorry, something went wrong.
|
@ChALkeR @trevnorris ... what's the status on this? |
Sorry, something went wrong.
|
@jasnell I need to re-apply this (some places mentioned in the above list were already fixed by other patches), and then re-test to see if there is any actual improvement with the current v8 version in master. |
Sorry, something went wrong.
|
Closing, obsolete. See #4361, also current master has rest parameters enabled by default, perhaps this should be redone using those. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This prevents leaking arguments in several places.
Not yet final, I will probably update this with more patches, waiting for comments.
Currently the three fixed places are util.format (called for example by console.log), console.assert, and path.win32.join.
In path.win32.join this PR changes the stack of the TypeError('Arguments to path.join must be strings'), removing the top at f (path.js:190:13) and at Object.filter (native) so now it is similar to the stack in path.posix.join.
util.format results:
console.assert results:
path.win32.join results:
See #1749 (comment), https://gist.github.com/Fishrock123/98c35a0c745cb59d7496 and https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#3-managing-arguments