@@ -179,6 +179,21 @@ they do not corrupt reporter output.
179179has lower startup overhead, but module, heap, and process state carry between
180180files, and user writes share stdout and stderr with reporters.
181181
182+ Worker-thread isolation is not a CLI mode. Each newly constructed {Worker} has a
183+ separate V8 isolate, JavaScript heap, and event loop, typically with lower
184+ startup cost than a child process. Reusing a worker preserves its module and heap
185+ state. Workers also share libuv's process-wide thread pool and can share
186+ process-global native or addon state, so they do not provide the same boundary
187+ as process isolation.
188+
189+ Higher-level tools can experiment with worker isolation by loading benchmark
190+ code inside a worker, measuring there, transferring structured sample data, and
191+ passing it to [ ` context.record() ` ] [ ] . The reported ` duration_ns ` can exclude
192+ message transport when the worker captures both timestamps. Tools should
193+ identify worker modules and workloads explicitly. They should not stringify
194+ arbitrary functions or closures to move them between isolates, because closures
195+ cannot be reconstructed with their original lexical environment.
196+
182197Benchmark files passed to ` --bench ` should declare benchmarks but must not call
183198` run() ` . The CLI supports ` --bench-name-pattern ` , ` --bench-samples ` ,
184199` --bench-warmup ` , ` --bench-reporter ` , and ` --bench-reporter-destination ` . See
@@ -710,6 +725,7 @@ A completed benchmark result contains:
710725 interval for the median rate, with ` lower ` and ` upper ` properties.
711726 * ` skewness ` {number} The skewness of the scaled rate histogram.
712727
728+ [ `context.record()` ] : #contextrecordsample
713729[ `run()` ] : #runoptions
714730[ benchmark result ] : #benchmark-result
715731[ command-line options documentation ] : cli.md#--bench
0 commit comments