Uh oh!
There was an error while loading. Please reload this page.
WIP events: optimize emit() - #533
Conversation
There was a problem hiding this comment.
Is there any difference between throw new Error and throw Error.
There was a problem hiding this comment.
Think the specification states that will always return a new Error object regardless. But since I'm there might as well switch it up to use new.
indutny
commented
Jan 21, 2015
Mostly LGTM if it boosts performance or at least does not kill it ;) |
trevnorris
commented
Jan 21, 2015
@indutny Thanks. I'm going to sleep on it. There's still more to do. I would like to further implement an in JS IC that can preemptively call the correct emit function. |
5c1ba98 to
4672003CompareThere was a problem hiding this comment.
I feel like the function name should reflect that you should !this._events.error before calling. Perhaps $emitUncaughtError?
EventEmitter#emit() can be called with many different arguments, but there are a few that are most common. Increase performance by optimizing those most common cases. It also drastically decreases the amount of output from --trace_deopt.
4672003 to
77b0098Comparecharmander
commented
Jan 28, 2015
Is there a useful benchmark available? |
trevnorris
commented
Feb 6, 2015
Superseded by #601 |
EventEmitter#emit() can be called with many different arguments, but
there are a few that are most common. Increase performance by optimizing
those most common cases. It also drastically decreases the amount of
output from --trace_deopt.
This is a hyper optimization and will probably on save 100ns or so at actual runtime. One thing I find most advantageous is that
--trace_deoptwill show far less output.There is still plenty that I would like to do. For example, implement a sort of IC in JS that will preempt what will be called. Would like feedback during development. Also one of the "message" tests is failing because of the change in the call stack. Will take care of that before WIP is removed.
R=@indutny