-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Fix fs.read bailout
#3654
Fix fs.read bailout
#3654
Conversation
When profiling my application I noticed that V8 bails out on `fs.read` function, due to access to `arguments` array when named paramaters are given.
|
What performance difference are we talking here? |
|
Isn't it a problem in V8 itself? Accessing arguments by index should be the same performance-wise, shouldn't it? |
Ideally, yes. In practice, no. V8 tends to deoptimize (or not optimize at all) functions that use the arguments object. Run your script with |
|
It's hard to tell what's the performance impact. I just assumed that the less bailouts and deopts we have, the better it is. |
|
Only if it makes a substantial difference. In this case, we're talking about a deopt in the code path of a deprecated feature of a function that's dominated by I/O anyway. Thanks but I won't take the patch. |
Fix node exiting due to an exception being thrown rather than emitting an `'uncaughtException'` event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an `'uncaughtException'` event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. Finally, change the behavior of --abort-on-uncaught-exception so that, if the domain within which the error is thrown has no error handler, but a domain further up the domains stack has one, the process will not abort. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3654 PR-URL: nodejs/node#3654 Reviewed-By: Chris Dickinson <chris@neversaw.us>
Notable changes:
* buffer:
- Buffer.prototype.includes() has been added to keep parity
with TypedArrays. (Alexander Martin) nodejs#3567.
* domains:
- Fix handling of uncaught exceptions.
(Julien Gilli) nodejs#3654.
* https:
- Added support for disabling session caching.
(Fedor Indutny) nodejs#4252.
* repl:
- Allow third party modules to be imported using
require(). This corrects a regression from 5.2.0.
(Ben Noordhuis) nodejs#4215.
* deps:
- Upgrade libuv to 1.8.0.
(Saúl Ibarra Corretgé) nodejs#4276.
PR-URL: nodejs/node#4281
Conflicts:
src/node_version.h
Fix node exiting due to an exception being thrown rather than emitting an `'uncaughtException'` event on the process object when: 1. no error handler is set on the domain within which an error is thrown 2. an `'uncaughtException'` event listener is set on the process Also fix an issue where the process would not abort in the proper function call if an error is thrown within a domain with no error handler and `--abort-on-uncaught-exception` is used. Finally, change the behavior of --abort-on-uncaught-exception so that, if the domain within which the error is thrown has no error handler, but a domain further up the domains stack has one, the process will not abort. Fixes nodejs#3607 and nodejs#3653. PR: nodejs#3654 PR-URL: nodejs/node#3654 Reviewed-By: Chris Dickinson <chris@neversaw.us>
Notable changes:
* buffer:
- Buffer.prototype.includes() has been added to keep parity
with TypedArrays. (Alexander Martin) nodejs#3567.
* domains:
- Fix handling of uncaught exceptions.
(Julien Gilli) nodejs#3654.
* https:
- Added support for disabling session caching.
(Fedor Indutny) nodejs#4252.
* repl:
- Allow third party modules to be imported using
require(). This corrects a regression from 5.2.0.
(Ben Noordhuis) nodejs#4215.
* deps:
- Upgrade libuv to 1.8.0.
(Saúl Ibarra Corretgé) nodejs#4276.
PR-URL: nodejs/node#4281
When profiling my application I noticed that V8 bails out on
fs.readfunction, due to access to
argumentsarray when named paramaters aregiven.