Skip to content

perf(benchmark): add Piscina(1) vs direct lintWorker comparison - #192

Merged
luojiyin1987 merged 1 commit into
masterfrom
bench/piscina-vs-direct
Sep 13, 2026
Merged

luojiyin1987 merged 1 commit into
masterfrom
bench/piscina-vs-direct

Conversation

@luojiyin1987

@luojiyin1987 luojiyin1987 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Both paths invoke the same compiled lintWorker.

Results are noisy:

  • Piscina is higher at 1/4/6/8/12 MiB
  • Piscina is lower at 2/10 MiB
  • No stable crossover point is visible
  • More repetitions are needed before using this data to justify a production optimization

@luojiyin1987
luojiyin1987 force-pushed the bench/piscina-vs-direct branch 2 times, most recently from 6b7817a to 5759d81 Compare September 13, 2026 07:01
@luojiyin1987 luojiyin1987 changed the title perf(benchmark): add Piscina(1) vs direct in-process comparison perf(benchmark): add Piscina(1) vs direct lintWorker comparison Sep 13, 2026
Compares Piscina(maxThreads=1) vs direct lintWorker invocation.
Both paths call the same worker function:
  readFile → fixMarkdown → toBatchLintItem

The only difference is whether lintWorker is called directly
or through Piscina + worker thread + structured clone.

Results (fix mode, single file, 3 runs each):

| File | Piscina RSS | Direct RSS | Δ RSS   | Piscina wall | Direct wall | Δ wall |
|------|-------------|------------|---------|--------------|-------------|--------|
| 1M   | 564 MiB     | 377 MiB    | +49.7%  | 1.0s         | 0.9s        | +14.8% |
| 2M   | 802 MiB     | 1029 MiB   | -22.0%  | 1.7s         | 1.9s        | -6.6%  |
| 4M   | 1839 MiB    | 1322 MiB   | +39.0%  | 3.6s         | 3.2s        | +14.5% |
| 6M   | 1289 MiB    | 1225 MiB   | +5.3%   | 4.1s         | 4.0s        | +3.0%  |
| 8M   | 2869 MiB    | 2374 MiB   | +20.9%  | 6.6s         | 6.1s        | +7.7%  |
| 10M  | 1883 MiB    | 2829 MiB   | -33.4%  | 6.2s         | 7.9s        | -21.0% |
| 12M  | 3172 MiB    | 2879 MiB   | +10.2%  | 9.5s         | 8.3s        | +14.5% |

Observations:
- Data is noisy. V8 GC timing and system load variation affect results.
- 2 MiB and 10 MiB show Piscina lower, others show Piscina higher.
- No clear crossover point. Results vary run-to-run.
- Requires more runs per cell to reduce noise.
@luojiyin1987
luojiyin1987 force-pushed the bench/piscina-vs-direct branch from 5759d81 to 4e210ef Compare September 13, 2026 07:07
@luojiyin1987
luojiyin1987 merged commit e3229a4 into master Sep 13, 2026
6 checks passed
@luojiyin1987
luojiyin1987 deleted the bench/piscina-vs-direct branch September 13, 2026 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant