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
|
@ -14,7 +14,7 @@ const { AsyncLocalStorage } = require('async_hooks');
|
|||
* - AsyncLocalStorage1.getStore()
|
||||
*/
|
||||
const bench = common.createBenchmark(main, {
|
||||
sotrageCount: [1, 10, 100],
|
||||
storageCount: [1, 10, 100],
|
||||
n: [1e4],
|
||||
});
|
||||
|
||||
|
@ -34,8 +34,8 @@ function runStores(stores, value, cb, idx = 0) {
|
|||
}
|
||||
}
|
||||
|
||||
function main({ n, sotrageCount }) {
|
||||
const stores = new Array(sotrageCount).fill(0).map(() => new AsyncLocalStorage());
|
||||
function main({ n, storageCount }) {
|
||||
const stores = new Array(storageCount).fill(0).map(() => new AsyncLocalStorage());
|
||||
const contextValue = {};
|
||||
|
||||
runStores(stores, contextValue, () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue