benchmarking icon indicating copy to clipboard operation
benchmarking copied to clipboard

Setup bluebird and/or wikipedia benchmarks for promise performance

Open bmeurer opened this issue 7 years ago • 12 comments

Specifically we're interested in the difference between regular runs with these workloads and runs where we have async_hooks enabled (see #181 for background).

bmeurer avatar Jan 15 '18 20:01 bmeurer

Also see the first item on the list for https://github.com/nodejs/diagnostics/issues/124.

bmeurer avatar Jan 15 '18 20:01 bmeurer

Ok, I managed to run the aforementioned benchmarks today with and without async_hooks, and the results show a significant slow-down, even with just an empty init hook.

Results for Node 9.3.0

The full results and benchmarks are available at https://github.com/bmeurer/async-hooks-performance-impact. Not sure it makes sense to include these benchmarks as part of the regular nightly runs at this point. It seems that we might first need to come to an agreement whether we think that async_hooks can be shipped liked this.

bmeurer avatar Jan 16 '18 12:01 bmeurer

@bmeurer By bluebird, do you mean with https://github.com/petkaantonov/bluebird/pull/1472 applied?

AndreasMadsen avatar Jan 16 '18 12:01 AndreasMadsen

No it's the bluebird benchmarks running with native promises.

bmeurer avatar Jan 16 '18 13:01 bmeurer

It looks like to implement async_hooks for promises V8 enters C++ code and then go back into JavaScript land to call actual callback. Should we somehow migrate promise hooks from C++ builtin to TF builtin to get a performance boost?

And probably it is not best place for this question but what is main use case for async_hooks? Is it for some kind of async context tracking?

alexkozy avatar Jan 17 '18 07:01 alexkozy

@gsathya already suggested to move the promise hooks to JS and eventually spec them. This would help to reduce the C++ overhead, but so far I don't think that's the only/main bottleneck.

bmeurer avatar Jan 17 '18 08:01 bmeurer

Discussed, last meeting, nothing for TSC to decide at this point. Let async hooks team address, removing tag for now.

mhdawson avatar Jan 31 '18 17:01 mhdawson

Seems like @nodejs/async_hooks hasn't been mentioned here yet. Doing so.

ofrobots avatar Jan 31 '18 17:01 ofrobots

Seems like the tsc-agenda label should be removed? If I'm wrong about that, by all means, add it again.

Trott avatar Feb 13 '18 04:02 Trott

@Trott thanks, I had removed manually from the last agenda, but forgot to remove the tag.

mhdawson avatar Feb 15 '18 17:02 mhdawson

@bmeurer since we have no other promise centric benchmarks I'm wondering if running these nightly would be better than nothing?

mhdawson avatar Apr 02 '18 17:04 mhdawson

@mhdawson Makes sense. I've created versions of these benchmarks, see https://github.com/v8/promise-performance-tests, which we use for V8 internally to track Promise and async/await performance. Shouldn't be hard to setup on Node infrastructure as well (and run with async_hook on and off).

bmeurer avatar Apr 03 '18 04:04 bmeurer