Skip to content

sublimelsp/node-pointer-compression-builds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-pointer-compression-builds

Custom builds of Node.js with V8 pointer compression enabled. Pointer compression shrinks V8 heap pointers from 8 bytes to 4 bytes, reducing heap memory usage significantly for applications with many heap-allocated objects.

Prebuilt binaries for all platforms are published as GitHub Releases. Each release is triggered manually via the "Build Node.js from Source" Actions workflow.

Build flags

All builds are configured with:

Flag Effect
--experimental-enable-pointer-compression Compress V8 heap pointers from 8 → 4 bytes
--experimental-pointer-compression-shared-cage Share the compression cage across Isolates in the same process
--without-siphash Use a simpler alternative to SipHash for V8 hash seeds

Platforms

Platform Architecture Runner
Linux x64 ubuntu-22.04
Linux arm64 ubuntu-22.04-arm
macOS x64 macos-15-intel
macOS arm64 macos-15 (Apple Silicon)
Windows x64 windows-2025
Windows arm64 windows-11-arm

Patches

The builds apply a small set of patches, sourced from the Electron project, on top of the Node.js source tree, stored in patches/. These are necessary to make the pointer-compression build work:

  • support_v8_sandboxed_pointers — refactors several allocators to allocate within the V8 memory cage, required when V8_SANDBOXED_POINTERS is active.
  • random_build_flag_changes — enables the V8 sandbox (v8_enable_sandbox) when pointer compression is on, matching V8's expectations.
  • api_remove_deprecated_getisolate — replaces a deprecated context->GetIsolate() call with Isolate::GetCurrent(), required by newer V8.

Adding a new patch

cd node-src
vim some/code/file.cc
git commit
../script/git-export-patches -o ../patches

Note

git-export-patches ignores uncommitted files — create a commit first. The commit subject line becomes the patch file name; the body should explain why the patch exists.

Re-exporting patches may cause shasums in unrelated patches to change. This is harmless — include those changes in your PR anyway to keep things consistent for others.

Building locally

./build.sh

This clones Node.js at the pinned tag, applies all patches, configures with the pointer-compression flags, and installs the result into ./release/.

About

NodeJS runtime pointer compression builds

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors