Skip to content

Commit a12dfe9

Browse files
committed
fix(cli): run is now default command
1 parent 731a50b commit a12dfe9

File tree

10 files changed

+162
-125
lines changed

10 files changed

+162
-125
lines changed

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ export default {
122122

123123
```bash
124124
# Run all benchmarks
125-
modestbench run
125+
modestbench
126126

127127
# Run with specific options
128-
modestbench run --iterations 5000 --reporters human,json
128+
modestbench --iterations 5000 --reporters human,json
129129
```
130130

131131
### View Results
@@ -182,22 +182,22 @@ Run benchmarks with sensible defaults:
182182

183183
```bash
184184
# Run benchmarks in current directory and bench/ (top-level only)
185-
modestbench run
185+
modestbench
186186

187187
# Run all benchmarks in a directory (searches recursively)
188-
modestbench run benchmarks/
188+
modestbench benchmarks/
189189

190190
# Run benchmarks from multiple directories
191-
modestbench run src/perf/ tests/benchmarks/
191+
modestbench src/perf/ tests/benchmarks/
192192

193193
# Run specific files
194-
modestbench run benchmarks/critical.bench.js
194+
modestbench benchmarks/critical.bench.js
195195

196196
# Mix files, directories, and glob patterns
197-
modestbench run file.bench.js benchmarks/ "tests/**/*.bench.ts"
197+
modestbench file.bench.js benchmarks/ "tests/**/*.bench.ts"
198198

199199
# With options
200-
modestbench run \
200+
modestbench \
201201
--config ./config.json \
202202
--iterations 2000 \
203203
--reporters human,json,csv \
@@ -217,19 +217,19 @@ The `--limit-by` flag controls whether benchmarks are limited by time, iteration
217217

218218
```bash
219219
# Limit by iteration count (fast, predictable sample size)
220-
modestbench run --iterations 100
220+
modestbench --iterations 100
221221

222222
# Limit by time budget (ensures consistent time investment)
223-
modestbench run --time 5000
223+
modestbench --time 5000
224224

225225
# Limit by whichever comes first (safety bounds)
226-
modestbench run --iterations 1000 --time 10000
226+
modestbench --iterations 1000 --time 10000
227227

228228
# Explicit control (overrides smart defaults)
229-
modestbench run --iterations 500 --time 5000 --limit-by time
229+
modestbench --iterations 500 --time 5000 --limit-by time
230230

231231
# Require both thresholds (rare, for statistical rigor)
232-
modestbench run --iterations 100 --time 2000 --limit-by all
232+
modestbench --iterations 100 --time 2000 --limit-by all
233233
```
234234

235235
**Smart Defaults:**
@@ -252,16 +252,16 @@ Run specific subsets of benchmarks using tags:
252252

253253
```bash
254254
# Run only benchmarks tagged with 'fast'
255-
modestbench run --tags fast
255+
modestbench --tags fast
256256

257257
# Run benchmarks with multiple tags (OR logic - matches ANY)
258-
modestbench run --tags string,array,algorithm
258+
modestbench --tags string,array,algorithm
259259

260260
# Exclude specific benchmarks
261-
modestbench run --exclude-tags slow,experimental
261+
modestbench --exclude-tags slow,experimental
262262

263263
# Combine: run fast benchmarks except experimental ones
264-
modestbench run --tags fast --exclude-tags experimental
264+
modestbench --tags fast --exclude-tags experimental
265265
```
266266

267267
**Key Features:**
@@ -588,7 +588,7 @@ jobs:
588588

589589
- name: Run Benchmarks
590590
run: |
591-
modestbench run \
591+
modestbench \
592592
--reporters json,csv \
593593
--output ./results
594594
@@ -607,7 +607,7 @@ import { execSync } from 'child_process';
607607
import { readFileSync } from 'fs';
608608

609609
// Run current benchmarks
610-
execSync('modestbench run --reporters json --output ./current');
610+
execSync('modestbench --reporters json --output ./current');
611611
const current = JSON.parse(readFileSync('./current/results.json'));
612612

613613
// Load baseline results

site/src/content/docs/getting-started/index.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ export default {
115115
Run all benchmarks in the current directory:
116116

117117
```bash
118-
modestbench run
118+
modestbench
119119
```
120120

121121
Run benchmarks with options:
122122

123123
```bash
124-
modestbench run --iterations 5000 --reporters human,json
124+
modestbench --iterations 5000 --reporters human,json
125125
```
126126

127127
### Choosing an Engine
@@ -130,10 +130,10 @@ modestbench provides two engines with different trade-offs:
130130

131131
```bash
132132
# Default: tinybench (fast, good for development)
133-
modestbench run
133+
modestbench
134134

135135
# Accurate engine (higher precision, recommended for production benchmarks)
136-
node --allow-natives-syntax ./node_modules/.bin/modestbench run --engine accurate
136+
node --allow-natives-syntax ./node_modules/.bin/modestbench --engine accurate
137137
```
138138

139139
**Engine Comparison:**
@@ -167,16 +167,16 @@ Run specific files or directories:
167167

168168
```bash
169169
# Run a specific file
170-
modestbench run benchmarks/critical.bench.js
170+
modestbench benchmarks/critical.bench.js
171171

172172
# Run all benchmarks in a directory (searches recursively)
173-
modestbench run benchmarks/
173+
modestbench benchmarks/
174174

175175
# Run multiple paths
176-
modestbench run benchmarks/ tests/perf/
176+
modestbench benchmarks/ tests/perf/
177177

178178
# Use glob patterns
179-
modestbench run "tests/**/*.bench.ts"
179+
modestbench "tests/**/*.bench.ts"
180180
```
181181

182182
## View Results
@@ -202,36 +202,36 @@ The output above is from the `human` reporter, used automatically in interactive
202202

203203
```bash
204204
# Limit by iteration count (fast, predictable sample size)
205-
modestbench run --iterations 100
205+
modestbench --iterations 100
206206

207207
# Limit by time budget (ensures consistent time investment)
208-
modestbench run --time 5000
208+
modestbench --time 5000
209209

210210
# Limit by whichever comes first (safety bounds)
211-
modestbench run --iterations 1000 --time 10000
211+
modestbench --iterations 1000 --time 10000
212212
```
213213

214214
### Filter by Tags
215215

216216
```bash
217217
# Run only fast benchmarks
218-
modestbench run --tags fast
218+
modestbench --tags fast
219219

220220
# Run benchmarks with multiple tags (OR logic)
221-
modestbench run --tags string,array,algorithm
221+
modestbench --tags string,array,algorithm
222222

223223
# Exclude specific benchmarks
224-
modestbench run --exclude-tags slow,experimental
224+
modestbench --exclude-tags slow,experimental
225225
```
226226

227227
### Multiple Output Formats
228228

229229
```bash
230230
# Generate multiple reports at once
231-
modestbench run --reporters human,json,csv
231+
modestbench --reporters human,json,csv
232232

233233
# Save reports to a specific directory
234-
modestbench run --reporters json,csv --output ./results
234+
modestbench --reporters json,csv --output ./results
235235
```
236236

237237
## Next Steps
@@ -247,7 +247,7 @@ modestbench run --reporters json,csv --output ./results
247247
Use `--warmup` to run warmup iterations before measurement:
248248

249249
```bash
250-
modestbench run --warmup 100
250+
modestbench --warmup 100
251251
```
252252

253253
This helps stabilize JIT compilation for more accurate results.

site/src/content/docs/guides/advanced.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ Choose an engine based on your requirements:
1313

1414
```bash
1515
# Tinybench engine (default) - fast development iteration
16-
modestbench run --engine tinybench
16+
modestbench --engine tinybench
1717

1818
# Accurate engine - high-precision measurements
19-
node --allow-natives-syntax ./node_modules/.bin/modestbench run --engine accurate
19+
node --allow-natives-syntax ./node_modules/.bin/modestbench --engine accurate
2020
```
2121

2222
### Statistical Improvements
@@ -57,7 +57,7 @@ CV > 20% → Poor (investigate noise sources)
5757
Example output showing CV:
5858

5959
```bash
60-
$ modestbench run --engine accurate --allow-natives-syntax --reporters json
60+
$ modestbench --engine accurate --allow-natives-syntax --reporters json
6161
{
6262
"name": "Array.push()",
6363
"mean": 810050, // nanoseconds
@@ -75,11 +75,11 @@ Real-world comparison using `examples/benchmarks`:
7575

7676
```bash
7777
# Tinybench (fast iteration)
78-
$ modestbench run --engine tinybench --reporters json
78+
$ modestbench --engine tinybench --reporters json
7979
# Typical run time: 3-5 seconds for 5 benchmark files
8080

8181
# Accurate (high precision)
82-
$ node --allow-natives-syntax ./node_modules/.bin/modestbench run --engine accurate --reporters json
82+
$ node --allow-natives-syntax ./node_modules/.bin/modestbench --engine accurate --reporters json
8383
# Typical run time: 8-12 seconds for 5 benchmark files
8484
```
8585

@@ -272,19 +272,19 @@ export default {
272272

273273
```bash
274274
# Run only fast benchmarks
275-
modestbench run --tags fast
275+
modestbench --tags fast
276276
# Runs: 'RegExp Test', 'String Includes'
277277

278278
# Run string OR array benchmarks
279-
modestbench run --tags string,array
279+
modestbench --tags string,array
280280
# Runs: All tasks in 'String Operations' and 'Array Operations'
281281

282282
# Exclude slow benchmarks
283-
modestbench run --exclude-tags slow
283+
modestbench --exclude-tags slow
284284
# Runs: Only 'String Operations' tasks
285285

286286
# Combine: run fast benchmarks except experimental
287-
modestbench run --tags fast --exclude-tags experimental
287+
modestbench --tags fast --exclude-tags experimental
288288
```
289289

290290
### Suite Lifecycle with Filtering
@@ -322,10 +322,10 @@ export default {
322322

323323
```bash
324324
# Setup and teardown run (Fast Task matches)
325-
modestbench run --tags fast
325+
modestbench --tags fast
326326

327327
# Setup and teardown DON'T run (Slow Task excluded)
328-
modestbench run --exclude-tags slow
328+
modestbench --exclude-tags slow
329329
```
330330

331331
## Custom Task Configuration
@@ -417,7 +417,7 @@ jobs:
417417

418418
- name: Run benchmarks
419419
run: |
420-
modestbench run \
420+
modestbench \
421421
--reporters json,csv \
422422
--output ./results \
423423
--quiet \
@@ -441,7 +441,7 @@ import { execSync } from 'child_process';
441441
import { readFileSync } from 'fs';
442442

443443
// Run current benchmarks
444-
execSync('modestbench run --reporters json --output ./current', {
444+
execSync('modestbench --reporters json --output ./current', {
445445
stdio: 'inherit',
446446
});
447447

@@ -634,7 +634,7 @@ Concurrent execution is experimental and may produce inconsistent results.
634634
Run benchmark files concurrently for faster execution:
635635

636636
```bash
637-
modestbench run --concurrent
637+
modestbench --concurrent
638638
```
639639

640640
**Considerations:**

0 commit comments

Comments
 (0)