The First WebAssembly-Powered Search Engine

Sprigr compiles your search index into a compact WASM module that runs entirely in the browser. Sub-10ms queries, zero server calls, zero per-search costs.

Start My Free Trial

How WebAssembly search works

Three steps from your data to instant, client-side search.

1

Push your data

Send records to the Sprigr REST API. Products, articles, docs — any JSON. The API is familiar if you have used Algolia.

2

We compile it to WASM

Sprigr builds a compact binary search index and packages it as a WebAssembly module. A typical 10,000-record index is 1–5 MB.

3

Users search locally

The 155 KB WASM engine loads in the browser. Every keystroke is scored, filtered, and highlighted locally in under 10 ms.

Why WASM beats server-side search

Traditional search sends every keystroke over the network. WASM search keeps everything local.

Server-side search

  • 100–300 ms per keystroke (network round-trip)
  • Cold starts on serverless platforms
  • Rate limits and per-query billing
  • User queries logged on third-party servers
  • Breaks when offline or on slow connections

WASM search (Sprigr)

  • Sub-10 ms per keystroke (local computation)
  • No cold starts — module is already loaded
  • Zero per-query costs, no rate limits
  • No user data leaves the browser
  • Works offline after initial load

Under the hood

The engineering that makes sub-10ms search possible in a 155KB binary.

Bitmap-based filtering

Facet filters use bitwise AND + popcount operations, processing 64 results at a time. Filter 10,000 records across dozens of attributes in microseconds.

Typo-tolerant scoring

Levenshtein distance with length pre-filtering skips 90% of impossible matches. Single-row byte-level DP computes the rest. Words under 4 characters allow 0 typos; 4–7 allow 1; 8+ allow 2.

Compact binary index

A custom binary format with a shared string table, packed bitmaps, and varint encoding. A 10,000-record product catalog compresses to 1–5 MB of index data.

Prefix matching

As-you-type prefix indexing means results appear from the first keystroke. Combined with trigram overlap scoring for partial and fuzzy matches.

Edge deployment

Sprigr’s backend runs on Cloudflare Workers across 300+ locations. Your WASM index is served from the nearest edge node, minimizing initial load time.

Highlight matching

Results include highlighted matches for exact, prefix, and fuzzy/typo matches. Even misspelled words are highlighted in the results so users understand why a result matched.

One script tag. Instant search.

Drop the Sprigr widget into any page. The WASM engine loads your pre-compiled index and searches locally.

HTML
<script src="https://cdn.sprigr.com/v1/sprigr.js"
        data-index="your-index-id"
        data-key="your-search-api-key"></script>

That is the entire client-side integration. The REST API handles data ingestion, and the WASM module handles search. No backend code required on your end.

Frequently asked questions

What browsers support WebAssembly search?

All modern browsers support WebAssembly, covering over 96% of global users. This includes Chrome, Firefox, Safari, Edge, and mobile browsers on iOS and Android. For the rare legacy browser, Sprigr can fall back to a server-side REST API.

How large is the WASM search index?

The base Sprigr WASM engine is 155 KB. The search index size depends on your data — typically 1–5 MB for 10,000 records. The index is loaded once and cached by the browser, so subsequent visits are instant.

Does WebAssembly search work offline?

Yes. Once the WASM module and index are loaded in the browser, all search queries run locally with no network dependency. This makes Sprigr ideal for PWAs, mobile apps with spotty connectivity, and offline-capable applications.

Can I fall back to a REST API for search?

Yes. Sprigr provides a standard REST API for server-side search alongside the client-side WASM module. You can use the API for server-rendered pages, legacy browsers, or very large indexes that exceed the practical WASM size limit.

How does Sprigr compare to open-source WASM search tools?

Open-source tools like Stork Search (now unmaintained) and Tinysearch pioneered client-side WASM search, but require you to host and compile indexes yourself. Sprigr is a managed service: you push data via API, and we handle index compilation, hosting, updates, and analytics. Learn more about migrating from Stork Search.

Try WebAssembly search for free

Full access for 6 months. No credit card required.

Start My Free Trial