Articles

PDF generation speed: Palatine, Puppeteer, DocRaptor

Ten documents timed with Palatine, with Puppeteer and Chromium, cold and warm, and through DocRaptor, with an estimate of what Prince itself takes.

By Palatine · Published · Updated

Most HTML-to-PDF pipelines are built on one of two things: a headless browser driven by Puppeteer, or Prince, often rented through DocRaptor. We rendered the same ten documents with Palatine, with Puppeteer and Chromium, and through the DocRaptor API, and timed each of them.

Palatine’s native, Node.js and Wasmtime figures were updated on 15 November 2026 on the same VPS, using 15 measured runs and a 96 MiB engine budget. Puppeteer, Chromium and DocRaptor retain their 13 November 2026 measurements (7 runs). The separate scaling experiment below retains its original date and build. Downloads identify the source and protocol of every target.

The short version: from a cold start, Palatine delivers an invoice 16× sooner than Chromium and is faster on most of the corpus. Once both are running, Chromium is faster on 4 of the 10 documents, and by a wide margin on a report made of tables. The original scaling experiment found Prince faster than the Palatine build tested then on both documents, but with DocRaptor you mostly wait for the service, not for Prince. The rest of this page gives the numbers, how they were taken and where they stop being comparable. Download every sample, version and file hash.

What was measured

The documents are the ten fixtures of our performance corpus: an invoice, a web page, a long article, a table-heavy report, an image album, a page of advanced CSS, a short report, a book, a book with footnotes and a dictionary with running headers. Each one is rendered to PDF with the same HTML and the same font, Noto Sans. Everything ran on one Linux server: AMD EPYC Processor (with IBPB), 6 cores, 11.7 GiB of memory. Palatine figures use 15 runs; the retained competitor figures use 7.

A time only means something with its boundaries, so there are three groups:

  • One conversion, from nothing. A new process for every document, timed from start to exit. For Palatine this is the native command-line build, and the WebAssembly build inside Wasmtime. For Chromium it is a Node.js script that imports Puppeteer, launches the browser, opens a page, loads the file, calls page.pdf(), writes the result and closes the browser. This is the cost of a serverless function, a queue worker that scales to zero, or a script.
  • The next document, on a service that stays up. Palatine’s WebAssembly build in Node.js, timed around renderer.render() on a renderer that is already created. For Chromium, a browser that is already open: new page, load, page.pdf(). Palatine gets 16 warm-up renders first; the retained Chromium run used 5.
  • A hosted API. DocRaptor’s synchronous endpoint, timed from the request to the last byte of the PDF, over a connection that is already open.

1 PDF page in Palatine. Palatine: 15 runs, 15 November 2026. Other engines: 7 runs, 13 November 2026. Shorter is better.

One conversion, from nothing

A new process for each document: start, load, render, write.

  1. Palatine native 57 ms
  2. Palatine WASM · Wasmtime 332 ms
  3. Puppeteer + Chromium 909 ms

The next document, on a service that stays up

Engine or browser already running and warmed up.

  1. Palatine WASM · Node.js 35 ms
  2. Puppeteer + Chromium 196 ms

Hosted API

Round trip from our server to DocRaptor, fonts included in the request.

  1. DocRaptor (Prince) 2.57 s

Starting from nothing

A one-page invoice takes 57 ms with Palatine’s native build and 909 ms with Puppeteer and Chromium: 16× longer. Chromium spends a median of 456 ms launching before it has seen the document; that part does not depend on what you print.

Palatine’s native build is faster on 9 of the 10 documents, by up to 16× on the invoice. Palatine is slower on the table-heavy report: 1.98 s against 1.79 s, where rendering takes long enough to outweigh the browser’s launch.

The WebAssembly build in Wasmtime pays for instantiating a 22.5 MiB module on every run. It is faster than cold Chromium on 6 documents, level on 1 and slower on 3. Its compilation cache was primed; the very first run on a machine compiles the module and took 6.64 s here.

One conversion, complete process · median milliseconds
DocumentPalatine nativePalatine WASM, WasmtimePuppeteer + Chromium
Invoice57332909
Web page1725591,129
Long article7179651,192
Table-heavy report1,9762,7001,794
Image album5011,2771,320
Advanced layout7591,6441,313
Short report1774961,128
Book8441,3731,214
Book with footnotes3727031,194
Running-header dictionary68319984

A service that stays up

Once both are running, the picture changes. Palatine is still faster on 5 documents, the short ones first: the invoice takes 35 ms against 196 ms. But a warm Chromium is faster on 4 of the 10 documents, level on 1, and the gap is widest on the table-heavy report: 1.08 s for Chromium, 1.78 s for Palatine, 1.7× longer.

We are not surprised by the direction. Chromium’s layout engine has had many more years of optimization than ours, and it spreads its work over several processes. Tables are the slowest part of Palatine on this corpus, and automatic hyphenation of the long article is another known cost. If your documents are long reports and you already operate a browser pool, Chromium will produce them sooner.

Next document on a running service · median milliseconds
DocumentPalatine WASM, Node.jsPuppeteer + Chromium
Invoice35196
Web page206536
Long article488432
Table-heavy report1,7821,076
Image album629653
Advanced layout981704
Short report157359
Book770526
Book with footnotes321460
Running-header dictionary43227

These two groups have different boundaries. The first includes starting a process and reading files; the second does not. Compare engines inside a group, then pick the group that matches how you deploy.

The engines do not print the same pages

A faster result is only better if it is the same document. Every PDF was parsed after the run: page count, extracted text, embedded font. The text matches closely, the pages do not always:

Pages in the PDF
DocumentPalatineChromiumPrince
Invoice111
Web page223
Long article252625
Table-heavy report282828
Image album8823
Advanced layout151318
Short report242424
Book106104107
Book with footnotes484748
Running-header dictionary444
  • Chromium does less on two documents. It has no footnotes and no running headers taken from the text (string-set). The book with footnotes is printed with its notes in the flow, and the dictionary’s page headers stay empty: its PDF holds 99.5% of the text for the book with footnotes and 89.1% of the text for the running-header dictionary. Palatine and Prince lay both out as written.
  • The book uses Knuth–Plass in Palatine only. The fixture asks for it, and it costs time that the two other engines do not spend: they break lines one at a time.
  • The web page and the long article are paginated here. In our own corpus they are single continuous pages, which neither Chromium nor Prince produces. For this comparison they get a page of their viewport size and no margins, in all three engines.
  • Page counts differ on the web page, long article, image album, advanced layout, book and book with footnotes. Line breaking, hyphenation and the support of grid and multi-column layout are not identical between engines. We report the counts and did not tune the documents to make them agree.

DocRaptor, and what it says about Prince

We did not run Prince ourselves: it is measured through DocRaptor, which runs Prince 15.1. A round trip took between 2.39 s and 3.20 s depending on the document. Palatine’s native build, run locally, finishes before the DocRaptor response arrives on 10 of the 10 documents.

That round trip is not Prince’s rendering time, and it would be unfair to present it as such. Three things are in it:

  • The network. DocRaptor’s response carries an x-runtime header: the time spent on their server. Subtracting it from the round trip leaves between 633 and 1,208 ms outside their server. Most of that is the upload. A request has to carry its fonts, 1.7 MiB here, and our server is far from theirs: a new connection takes 225 ms to open, before TLS. A request of 195 bytes leaves only 125 ms outside.
  • The service. A document that contains a single word still takes 1.53 s on their server. Whatever the service does around Prince, such as queueing the job, starting it and storing the result, costs that much before any layout happens.
  • Prince. What is left.

To isolate that last part, every document request was preceded by a control request: the one-word document, padded with a comment to the same size. Both travel the same way and cost the service the same. The difference between their server times should be what Prince spent on the document itself.

DocRaptor · median milliseconds
DocumentRound tripServerControl, serverDifferencePalatine native
Invoice2,5681,5761,745−16957
Web page3,0711,8031,632+171172
Long article2,3871,7651,771−6717
Table-heavy report2,6591,8321,824+71,976
Image album2,9341,6861,693−6501
Advanced layout3,2022,4301,622+808759
Short report2,7101,6111,601+10177
Book2,6711,7051,652+53844
Book with footnotes2,4141,7921,567+225372
Running-header dictionary2,4311,7191,831−11368

This did not work, and it is worth saying why. The ten controls ask for the same work, yet their medians spread over 264 ms, and the difference is smaller than that for 9 of the 10 documents. The server times are not smooth either: the same request sometimes takes a second longer than the time before. One request tells us that Prince finished somewhere inside the service’s first second and a half, and nothing more precise.

Asking for more pages — historical scaling experiment

These scaling figures retain the 13 November 2026 experiment, including its older Palatine build. They are separate from the updated single-document Palatine measurements above; the Prince and DocRaptor measurements are unchanged.

What a fixed cost cannot hide is growth. We repeated the body of two documents 1, 4, 8 and 16 times and sent each version to DocRaptor 3 times, then rendered the same files with Palatine’s native build. The slope of the time against the number of copies is what one more copy costs, with every fixed cost removed. A copy is 28 pages of the table-heavy report in Prince and 107 pages of the book in Prince.

Cost of one more copy, then the median time for each number of copies · milliseconds
Document and enginePer copyPer page×1×4×8×16
Table-heavy report · Prince through DocRaptor34112.21,5722,7063,6206,762
Table-heavy report · Palatine native5,1801854,97620,72940,73982,796
Book · Prince through DocRaptor3623.41,5702,5213,6736,990
Book · Palatine native, Knuth–Plass1,32712.51,4494,80210,09221,172
Book · Palatine native, line by line1,208111,0314,5578,84919,163

For Prince, the slope still contains what the service does in proportion to the document, such as receiving it and storing the PDF. It is an upper bound: Prince itself needs at most that.

  • Table-heavy report. One more copy costs Prince at most 341 ms and Palatine 5.18 s. Prince is at least 15× faster.
  • Book. One more copy costs Prince at most 362 ms and Palatine 1.33 s, or 1.21 s when Palatine breaks lines one at a time as Prince does. Prince is at least 3.3× faster on equal terms.

In that scaling experiment, Prince was clearly faster than the Palatine build tested, with a wide gap on tables. What you wait for with DocRaptor is something else: the service’s fixed cost and the network, which are the same for an invoice and for a book. That is why a local Palatine render still comes back before DocRaptor’s answer on most single documents, and why the order reverses once a document is long enough.

These figures have limits. Documents were sent in DocRaptor’s test mode, which is free and adds a watermark; we did not verify that paid requests are queued the same way. Everything was measured from one server, at one time of day. And it is an inference from timings, not a run of Prince on our hardware.

What you deploy

Speed is one side of the choice. Palatine’s native build is one 26.5 MiB file, and the WebAssembly build for Node.js and browsers is 12.1 MiB. The Chromium build measured here is a 260.7 MiB directory, and Node.js comes on top. Chromium also needs a sandbox or the decision to turn it off, a process to supervise, and somewhere to run that is not an edge worker or the user’s own browser tab.

Chromium gives you something Palatine does not: the whole web platform, JavaScript included. If your document is a web application that happens to need printing, use the browser. If it is a document — an invoice, a report, a book — the engines differ in what they can express on paper: footnotes, running headers and cross-references are in Palatine and Prince, not in Chromium.

Reproduce the measurements

The benchmark is in the repository, with the corpus. The updated Palatine engine is commit be3e7ec7. Each target below records its measurement date and number of timed samples; the retained competitor and scaling records identify their original versions.

TargetVersionTimed
Palatine nativenative C++ CLI
2026-11-15 · 15 samples
complete CLI process
Palatine WASM in Wasmtimewasmtime 50.0.1 (c307ec81d 2026-10-29)
Cranelift, on-disk compilation cache
2026-11-15 · 15 samples
complete CLI process, compilation cache primed
Palatine WASM in Node.jsNode v26.13.1
2026-11-15 · 15 samples
renderer.render() on an initialized renderer, one process per document
Puppeteer + Chromium, coldpuppeteer-core 25.17.0, HeadlessChrome/151.0.7922.34
chrome-headless-shell, --no-sandbox
2026-11-13 · 7 samples
complete Node process: import, browser launch, page, load, page.pdf(), write, close
Puppeteer + Chromium, warmpuppeteer-core 25.17.0, HeadlessChrome/151.0.7922.34
chrome-headless-shell, --no-sandbox
2026-11-13 · 7 samples
new page, load and page.pdf() in a browser kept open, one browser per document
Prince through DocRaptorPrince 15.1 (www.princexml.com)
2026-11-13 · 7 samples
HTTPS round trip of the synchronous API from this machine, connection kept alive
# Build the native, WASI and Emscripten targets first (docs/BUILD.md, docs/WASI.md).
# Refresh Palatine only, on the same machine as the retained competitor run:
bun run bench:engines -- --targets native,wasmtime,node --iterations 15 --warmup 16 --max-memory 100663296

# The download retains the original Chromium and DocRaptor samples.
# The historical scaling experiment is dated separately.

Some choices favour Chromium, on purpose. It runs as chrome-headless-shell, its fastest mode, and without its sandbox, as it does in most containers. In Chromium’s default headless mode the same invoice took 1,644 ms cold and 421 ms warm; that run is in the download too. The font is read from a local file, like Palatine’s. The warm case opens a new page for each document, which is how a service keeps documents apart.

Other choices limit what the numbers say. This is one shared server, and other work was running on it: individual samples vary, which is why the download keeps all of them. Nothing here measures concurrent requests, memory, or documents that load resources from the network. Palatine’s hosted API is not part of this comparison. Run your own documents on your own hardware before you size a service; the script takes a --filter.

Download the complete results · Browse the benchmark corpus · Palatine across runtimes · Palatine vs PrinceXML


All articles