mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
lib: rewrite AsyncLocalStorage without async_hooks
PR-URL: https://github.com/nodejs/node/pull/48528 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
This commit is contained in:
parent
0c1877a82a
commit
d1229eeca4
29 changed files with 658 additions and 173 deletions
|
@ -38,9 +38,11 @@ function runInAsyncScopes(resourceCount, cb, i = 0) {
|
|||
|
||||
function main({ n, resourceCount }) {
|
||||
const store = new AsyncLocalStorage();
|
||||
runInAsyncScopes(resourceCount, () => {
|
||||
bench.start();
|
||||
runBenchmark(store, n);
|
||||
bench.end(n);
|
||||
store.run({}, () => {
|
||||
runInAsyncScopes(resourceCount, () => {
|
||||
bench.start();
|
||||
runBenchmark(store, n);
|
||||
bench.end(n);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue