diff --git a/benchmark/async_hooks/async-local-storage-getstore-nested-resources.js b/benchmark/async_hooks/async-local-storage-getstore-nested-resources.js index 3474e801e01f35..65faa73440af04 100644 --- a/benchmark/async_hooks/async-local-storage-getstore-nested-resources.js +++ b/benchmark/async_hooks/async-local-storage-getstore-nested-resources.js @@ -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); + }); }); } diff --git a/benchmark/async_hooks/async-local-storage-getstore-nested-run.js b/benchmark/async_hooks/async-local-storage-getstore-nested-run.js index 5f8948f62eb13e..074a44b1ce261b 100644 --- a/benchmark/async_hooks/async-local-storage-getstore-nested-run.js +++ b/benchmark/async_hooks/async-local-storage-getstore-nested-run.js @@ -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, () => { diff --git a/doc/api/cli.md b/doc/api/cli.md index efd729e622af85..9f3e71eea45e8c 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -876,6 +876,21 @@ and `"` are usable. It is possible to run code containing inline types by passing [`--experimental-strip-types`][]. +### `--experimental-async-context-frame` + + + +> Stability: 1 - Experimental + +Enables the use of AsyncLocalStorage backed by AsyncContextFrame rather than +the default implementation which relies on async\_hooks. This new model is +implemented very differently and so could have differences in how context data +flows within the application. As such, it is presently recommended to be sure +your application behaviour is unaffected by this change before using it in +production. + ### `--experimental-default-type=type`