Skip to content
BACK TO CASE STUDIES
Partytown • Web Workers • Three.js

Off-Main-Thread Performance Engineering

The client demanded heavy tracking (HubSpot/GTM) and a 3D Hero section, but refused to accept anything less than a 95+ Lighthouse score.

Quantified Impact

Achieved a 99 Lighthouse Performance score

Technical Stack
PartytownWeb WorkersThree.jsNext.jsLighthouse
Off-Main-Thread Performance Engineering

The Architectural Cleanup

I utilized a "Worker-First" strategy. I moved all third-party marketing scripts into a Web Worker using Partytown, freeing 100% of the main thread for the user experience.

Engineering the Solution

I engineered a "Visual Shell" pattern: a high-res static WebP background that cross-faded into a Three.js canvas once the engine was hydrated in the background.

The 'Who Wrote This?' Chronicles

HubSpot was hijacking the main thread for 1.2s during initialization. By offloading it to a worker, we reclaimed our TTI (Time to Interactive) without losing a single lead-generation signal.

Strategic Trade-offs

Moving scripts to Web Workers can break certain DOM-dependent features. I had to build a custom bridge for HubSpot's cookie-consent modal to ensure it still functioned correctly while running off-thread.