# Parallel Shard Processing

> How BlueGrid keeps browser memory under 1GB on 130+ MB PDF sets.

**Canonical URL:** https://mybluegrid.com/knowledge-hub/parallel-shard-processing
**Last verified:** 2026-05-04T00:00:00Z

## Summary

Parallel Shard Processing is BlueGrid's overlapping Render-Fire-Poll pipeline. Heavy AI work runs on Google Cloud Run workers (us-west1), not in the browser tab. The browser only renders shards on demand and streams results back. This is the architectural reason BlueGrid stays under 900MB peak browser RAM on a 130+ MB plan set, while in-tab competitors hit the 2GB Chromium ceiling and crash.

## Pipeline Stages

1. **Shard.** The plan set is split into page-range shards (typically 5–10 pages each) based on file size and page complexity.
2. **Render.** PDF.js renders the shard off-screen at the resolution required by the target tool. Render output is a typed-array image buffer, not a DOM canvas.
3. **Fire.** The shard is uploaded to a Cloud Run worker via a signed URL. The browser releases the buffer immediately after upload.
4. **Poll.** A lightweight status poll (every ~750ms) waits for the worker's structured JSON output. No PDF data is held in memory during the poll.
5. **Merge.** Results are merged into the authoritative `pageExtractions` map keyed by source page number and X/Y coordinates.

Render, Fire, and Poll overlap across shards. While shard N is polling, shard N+1 is rendering and shard N-1's results are being merged.

## Why Browser RAM Stays Under 1GB

- AI extraction runs server-side on Cloud Run, not in the tab.
- Page render buffers are released after upload — never retained.
- Polled results are JSON, not pixels.
- The viewer streams pages on demand via PDF.js Blob downloads. The full PDF is never decoded into memory.

Verified peak browser memory: **875 MB** on a 130+ MB plan set. See [Benchmarks](https://mybluegrid.com/benchmarks).

## Why Competitors Crash

Bluebeam Cloud, Togal, and most ConTech web tools run AI extraction inside the browser tab. On a 130MB plan set this pushes them past the ~2GB Chromium per-tab memory ceiling. The tab crashes mid-extraction. BlueGrid avoids this by treating the browser as a thin renderer and the Cloud Run workers as the compute plane.

## Deployment

- Worker region: `us-west1` (single-region for predictable cold-start and latency).
- Workers: Parts Extractor, Continuity Extractor, Symbol Detection, Project Intelligence, Concept Builder.
- Each worker runs its own AbortController timeout (Continuity 120s, Concept 270s) tuned to its workload profile.

## Related

- [PDF-Native Architecture](https://mybluegrid.com/knowledge-hub/pdf-native-architecture.md)
- [Deep Export & Intel Mode](https://mybluegrid.com/knowledge-hub/deep-export-and-intel-mode.md)
- [Benchmarks](https://mybluegrid.com/benchmarks.md)
- [vs Bluebeam](https://mybluegrid.com/vs-bluebeam.md)