Spackle
Polyfills for Old Hardware, A core-js Replacement for TVs
4.4× faster first render on a 2017 LG TV. Up to 7× less garbage and 6× shorter GC pauses than core-js on old Chromium.
Spackle is a polyfill library for smart TVs, set top boxes and any other device where memory, garbage collection and execution time actually matter. One import, no config, and it swaps straight in for core-js.
Five months of building, eight months of testing, now in beta on npm.
The Problem, DRY Is Expensive on a Ten Year Old TV
Helper Chains: core-js is built the way a library should be. Every API routes through shared internals, each one small, each one correct. A single polyfilled Array.from walks a chain of nested helpers, and several of them allocate along the way.
Main Thread GC: On a modern machine that cost is noise. On the hardware that actually needs polyfills, garbage collection runs on the main thread. Every throwaway object is a pause waiting to happen, and the user feels it as a remote that stops responding.
The Approach, Write Everything Twice
Islands: Every Spackle polyfill is one function with no imports. Where a polyfill needs another polyfill, the dependency is inlined. No helper chains, no shared internals, and the hot path is a single frame with the work in it and nothing else.
No Throwaway Allocations: No iterator records, bound functions or options objects built per call. Less garbage means fewer collections and shorter pauses.
Proving the Design: I wrote the same Map polyfill twice, once as an island and once routed through shared helpers, with nothing else different. The island was 1.66× faster and produced 2.2× less garbage.
The Trade: A fix to duplicated logic has to land in every island that carries it. In return, an island's blast radius is the island. A fix for Array.from is never silently a change to Map and forty other entry points. And scope is narrower by choice: established APIs, browsers only, Chromium 38 and Safari 7.1 up.
The Numbers, Measured on the Devices That Need It
24 Chromium Versions: Spackle against core-js on every fifth Chromium release from 41 to 150, each run in a fresh browser with a 64 MB heap and one CPU core, GC data read from V8's own log. On Chromium 41: 6.1× less polyfill time, 6.6× less garbage, 7.4× fewer minor collections and 6.2× less time paused. From Chromium 69 both libraries step aside for native code and the two are level.
Real Hardware: A 2017 LG TV running Chromium 38 and the SolidTV demo app. Initial render went from 4.53s to 1.03s, frame rate from 34.8 to 47.1 fps, and the longest frame from 3.32s to 0.13s. The stress test on the same TV produced roughly 9× less garbage and a 37% lower peak heap.
Spec Compliance: 1,357 checks derived from test262 and the web platform tests, run in real browsers. There is no check core-js passes that Spackle fails. On Safari 7.1 core-js fails 125 and freezes the page on 4. Spackle fails 24.
Don't Trust Me, Race It on Your Own Device
Benchmarks from someone else's lab prove nothing about the box in front of you, so spackle.samseabourn.com runs on the TV itself. Open it, grab the remote and see how your device holds up.
Compare: A three part race against core-js. A simulated front end workload, every polyfill timed one by one, and a real React app. A coin toss decides who goes first.
Verify: The same 1,357 compliance checks, run against both libraries in whatever engine you are holding.
The Paper: Method, results and every raw data file behind the tables are published in the paper, including the performance trace from the TV.
The Tech Stack
Library: TypeScript, built with tsup down to ES5 and tested with Vitest. Every polyfill probes the engine before installing, so native code always wins.
Babel Plugin: Reads your code and your targets, then imports only the polyfills you actually use.
Verify Package: The compliance checks ship as their own package, with a plain script build for engines that have no module system, so a device fleet can be certified from the device.
Test Rig: A custom emulator covering every Chromium from 41 to 150, real Safari 7.1 to 11 and Chrome 38 for the engines that cannot be emulated, and a TV on my desk for the truth.
Why It Matters
Most performance work is deleting work that never needed doing. Spackle is that idea applied to a layer nobody looks at: the polyfills sitting under every legacy TV app, quietly filling the heap.
The box that has been plugged in since 2014 deserves nice things too.