benchmark: add eventEmitter.once() benchmarks#912
Conversation
|
|
||
| bench.start(); | ||
| for (var i = 0; i < n; i += 1) { | ||
| ee.emit('dummy'); |
There was a problem hiding this comment.
is this a very fair benchmark? after all, wouldn't any run after the first run be only to the .on() listeners?
There was a problem hiding this comment.
What do you suggest?
There was a problem hiding this comment.
just throwing ideas at the wall, but i'm thinking some sort of Object.freeze() (maybe deep-freeze) on the event emitter, which would (in non-strict mode) i believe silently fail when it is changed, leaving us the same object in each loop - thats the only idea that comes to mind that would only benchmark the .emit(), what do you think?
There was a problem hiding this comment.
How do const objects behave, would that do the job?
|
Right now, regarding these new benchmarks, I don't think most of them benchmark much. I don't really have any idea on how to fix that, but I don't think it's fair as-is. |
|
Well, at this point the benchmarks don't really matter unless #914 is merge-able. However as it stands, we need to know what kind of effect it will have on modules depending on |
|
@mscdex perhaps this should just be closed and reopened if it seems fit? |
|
Let's get @nodejs/benchmarking on this. |
No description provided.