You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/src/content/docs/guides/cli.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,43 @@ modestbench run --warmup 100
98
98
99
99
Helps stabilize JIT compilation for more consistent results.
100
100
101
+
##### `--engine <name>`
102
+
103
+
Select the benchmark engine. Options: `tinybench` (default) or `accurate`.
104
+
105
+
```bash
106
+
# Use the accurate engine for high-precision measurements
107
+
node --allow-natives-syntax ./node_modules/.bin/modestbench run --engine accurate
108
+
109
+
# Use tinybench engine (default)
110
+
modestbench run --engine tinybench
111
+
```
112
+
113
+
**Engine Differences:**
114
+
115
+
-**`tinybench`** (default): Fast, lightweight engine suitable for development and CI. Uses IQR-based outlier removal.
116
+
-**`accurate`**: High-precision engine with V8 optimization guards to prevent JIT compiler interference. Requires `--allow-natives-syntax` flag. Recommended for production benchmarks and critical performance measurements.
117
+
118
+
See the [Getting Started](/getting-started/#choosing-an-engine) guide for detailed comparison.
119
+
120
+
:::caution[Node.js Flag Required]
121
+
The `accurate` engine requires running Node.js with the `--allow-natives-syntax` flag. This flag must be passed to the Node.js runtime, not to modestbench:
122
+
123
+
```bash
124
+
# Using Node.js directly
125
+
node --allow-natives-syntax ./node_modules/.bin/modestbench run --engine accurate
126
+
127
+
# Using npx (pass flag to Node.js)
128
+
npx --node-arg=--allow-natives-syntax modestbench run --engine accurate
129
+
130
+
# Using package.json script
131
+
# package.json: "bench": "node --allow-natives-syntax ./node_modules/.bin/modestbench run --engine accurate"
132
+
npm run bench
133
+
```
134
+
135
+
If the flag is not present, AccurateEngine will fall back to a less accurate mode and display a warning.
136
+
:::
137
+
101
138
##### `--timeout <number>`
102
139
103
140
Maximum time in milliseconds for a single task before timing out.
High-precision timing with statistical analysis powered by `tinybench`. Get reliable measurements you can trust.
25
+
High-precision timing with advanced statistical analysis. Choose between the fast `tinybench` engine or the `accurate` engine with V8 optimization guards and IQR outlier removal.
0 commit comments