Post

RAM is the new bottleneck. Every Node.js process is fighting for memory: containers, serverless, cloud bills, k8s limits. And here's the maddening part: V8 can use half the memory with one flag, and almost nobody turns it on.

Pointer compression. V8 stores pointers as 32-bit offsets from a base address instead of full 64-bit pointers. That single change halves the size of every object in your heap.

Look at the numbers. Array of 1M objects: 40.47MB → 20.24MB. Nested objects (500K): 50.21MB → 24.64MB. Linked list: 19.08MB → 9.54MB. Every pointer-heavy structure drops ~50%.

So why is it still rare? Because until recently, enabling pointer compression meant building Node.js yourself from source with `--experimental-enable-pointer-compression`. There were no prebuilt binaries. Most people just... never tried it.

The other thing holding it back: compatibility. N-API addons (bcrypt, sharp, @napi-rs/*, argon2) work fine. But old V8 native addons, like anything using `nan`, can segfault under pointer compression. That's the tax you pay.

We decided to fix the "no binaries" problem. @platformatic has published multi-arch images of Node.js built with pointer compression enabled: Node.js 26 on trixie/slim/alpine. docker pull platformatic/node-caged

Disclaimer: prebuilds of native addons may or may not work.

0 reposts0 likes

If I recall correctly, years ago Deno shipped this and was forced to unship it due to some weird segfaults (?) I assume that’s been ironed out now upstream?

So I need double the builds if I do pre builds and non-napi. Not great but I don't see another solution.