Link preview benchmarks
Reproducible link preview benchmarks: linkpeek against five packages on large and small pages, install size, and how much of each page is read.
I measured linkpeek and five other link preview packages on November 15, 2026, with the same pages, the same local server and the same correctness check. The harness is open, so you can run it yourself. The pages are served locally, which means the numbers show library time without network latency (why a live preview takes longer). Where another package is the better fit, the library comparison says so.
- 500 kB page, vs the next-fastest package
- 4.0× faster
- Install size, vs the next-smallest package
- 2.4× smaller
- Runtime dependencies
- 1
Large pages
Each package previews the same 500 kB page whose metadata sits in the <head>. linkpeek stops reading after the head and cancels the response stream, so most of the body is never read or parsed.
Small pages
On small pages the packages are within about two milliseconds of each other, and real network latency dominates. unfurl.js was faster than linkpeek on every small fixture in this run: it requests pages with node-fetch over Node's http module, while linkpeek uses the platform fetch so the same code runs on Bun, Deno and Workers. Among the packages measured on fetch, linkpeek was fastest on every page.
Install footprint
linkpeek has one runtime dependency, htmlparser2. A small install matters most for serverless cold starts, container images and edge bundles.
Bytes read from a 500 kB page
The local stream probe serves a controlled 500 kB response in 1 kB chunks and records how much the parser requested.
| Mode | Source bytes requested | Configured ceiling | 500 kB page |
|---|---|---|---|
| Fast (default) | 2 kB | 30 kB | Stops after </head> |
| Quality | ~202 kB | 200 kB | Continues for body fallbacks |
“Source bytes” includes one 1 kB chunk that was already queued in the stream; the retained-byte ceiling itself is exact. The figures count requested chunks, not bytes on the wire.
Benchmarks and a live preview
These runs use a local server, so they measure the library, not the internet. A live preview also waits for the target site: DNS, the connection, TLS and the server's own response time. That wait is usually far longer than the library's work, and no parser can shorten it.
The homepage demo shows the two apart. "Site" is the time until the target's response headers arrive, summed over redirects. "Reading head" is linkpeek streaming the rest of the <head> and parsing it. On a real network, reading only the head still saves time on large pages, because linkpeek stops downloading after </head> instead of transferring the whole document.
Method
The packages run on a local server, so these numbers isolate library overhead; they do not predict latency against real websites. Median of three runs. Each run reports the median end-to-end preview time per fixture from a local HTTP server in the same Node.js process, after 5 warmups. Every timed result must extract the expected title.
Environment: Linux x64, 2 vCPU Intel Xeon 2.20 GHz, Node.js 24.22.2, npm 11.19.1. Versions: linkpeek@3.0.0, unfurl.js@6.4.0, link-preview-js@6.0.0, open-graph-scraper@6.13.0, url-metadata@6.3.1, metascraper@5.58.6.
linkpeek: Measured from the 3.0.0 source before publishing (merge commit bd1c9df); the install size is the published 2.1.7, which has the same single runtime dependency.link-preview-js: Measured as native fetch plus getPreviewFromContent(); its URL API rejects the private IP-literal benchmark host.open-graph-scraper: Measured as native fetch plus ogs({ html }); since 6.13.0 its URL API rejects non-public addresses with no opt-out.metascraper: Native fetch plus metascraper with 7 rule packages; metascraper does not fetch.
Timings depend on hardware: an earlier run on Apple silicon measured lower absolute numbers with the same ordering on the large page. The comparison notes keep every dated result, and the raw JSON runs include commit and environment details.
Run the benchmarks
npm ci
npm run benchmark
npm run build
cd benchmarks/competitive
npm ci
npm run bench -- --jsonThe competitive lockfile pins every compared version, and every timed preview must extract the expected title. The live benchmarks are network smoke tests, and I don't use them to compare packages.
Troubleshooting
Fix missing Open Graph metadata, HTTP errors, JavaScript-only pages, timeouts, and blocked URLs in server-side link previews.
All libraries
Compare linkpeek with link-preview-js, open-graph-scraper, metascraper, unfurl.js, and url-metadata by use case, API shape, security, and footprint.