Benchmark
Understand the current local benchmark setup and sample results for @omsimos/pdf-raster.
Sample local results
The numbers on this page are from a local benchmark run against the included fixture PDFs. Treat them as sample measurements, not universal guarantees.
What the benchmark compares
The benchmark currently compares three implementations on the same input PDFs and settings:
@omsimos/pdf-rasterpdfjs-dist + @napi-rs/canvaspdfjs-dist + node-canvas
Run it
bun run benchmarkDefault settings
Use the valid fixture PDFs under core/test/fixtures.
Render at dpi=300 with output=png.
Execute one warmup run, then repeated measured runs for each backend.
node-canvas requirement
The benchmark workspace includes both @napi-rs/canvas and node-canvas.
Depending on your machine, node-canvas may require native system
prerequisites before the benchmark can run successfully.
Sample output
File: multi-page.pdf
Settings: dpi=300, output=png, pages=all, warmups=1, runs=5
Input size: 842 B
Library Pages Avg total P50 total Avg/page Avg bytes
---------------------------- ----- --------- --------- -------- ---------
@omsimos/pdf-raster 2 1.72 ms 1.70 ms 0.86 ms 36.2 KB
pdfjs-dist + @napi-rs/canvas 2 11.96 ms 11.91 ms 5.98 ms 22.6 KB
pdfjs-dist + node-canvas 2 14.37 ms 14.37 ms 7.19 ms 22.8 KB
Relative speed (@omsimos/pdf-raster vs pdfjs-dist + @napi-rs/canvas): total 6.94x
Relative speed (@omsimos/pdf-raster vs pdfjs-dist + node-canvas): total 8.35x
File: single-page.pdf
Settings: dpi=300, output=png, pages=all, warmups=1, runs=5
Input size: 583 B
Library Pages Avg total P50 total Avg/page Avg bytes
---------------------------- ----- --------- --------- -------- ---------
@omsimos/pdf-raster 1 1.29 ms 1.00 ms 1.29 ms 13.4 KB
pdfjs-dist + @napi-rs/canvas 1 5.81 ms 5.83 ms 5.81 ms 7.6 KB
pdfjs-dist + node-canvas 1 7.25 ms 7.26 ms 7.25 ms 7.8 KB
Relative speed (@omsimos/pdf-raster vs pdfjs-dist + @napi-rs/canvas): total 4.51x
Relative speed (@omsimos/pdf-raster vs pdfjs-dist + node-canvas): total 5.63xHow to read the multipliers
The relative speed line is a multiplier, not a percentage.
- If the benchmark says
6.94x, it means the comparison backend took6.94times as long on that metric. - In other words,
@omsimos/pdf-rasterwas6.94xfaster on that sample.
What this benchmark is useful for
- compare end-to-end conversion speed on the included fixtures
- spot regressions between local runs
- compare the current PDFium-based package against
pdfjs-distcanvas backends
Use it as a practical engineering comparison tool, not as a universal claim about every PDF or every deployment environment.