Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
build: add flag to enable pointer compression#30463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Conversation
mcollina commented Nov 13, 2019
addaleax commented Nov 13, 2019
Yeah, that’s expected. Enabling pointer compression changes the Node.js ABI, which is IIRC the reason why we haven’t done this so far. |
addaleax left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a good story for our addon ABI
codebytere commented Nov 13, 2019
Electron feels similarly - the memory savings are positive especially considering they're per-isolate but we're concerned about ABI compat of native modules |
mcollina commented Nov 13, 2019
@gabrielschulhof can you confirm n-api can handle this case? |
mcollina commented Nov 13, 2019
@addaleax my goal for this is to make it easier for folks to experiment with address compression. If you are ok, I'll add the option as "(experimental)" in the ./configure help. |
addaleax commented Nov 13, 2019
N-API is unaffected.
That would be good, but I’d prefer to explicitly call out that this mode does not currently support addons (at all)? |
jasnell commented Nov 14, 2019
Definite +1 on marking this experimental and documenting the impact on native addons. Assuming those changes, this LGTM |
hashseed commented Nov 14, 2019
Yeah iirc the plan was to consider having a build flag in V8 that ensures ABI stability regardless of whether pointer compression is enabled or not, by sacrificing some performance, since inline-implemented APIs would need to be replaced by non-inline versions. |
d10e3d6 to 4ac9eb8Comparemcollina commented Nov 19, 2019
rvagg left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to enable so we can at least start playing with it
Uh oh!
There was an error while loading. Please reload this page.
4ac9eb8 to 7ec8e6dComparenodejs-github-bot commented Nov 22, 2019
mcollina commented Nov 22, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I've removed the config from cc @targos |
nodejs-github-bot commented Nov 22, 2019
nodejs-github-bot commented Nov 30, 2019
nodejs-github-bot commented Nov 30, 2019
Uh oh!
There was an error while loading. Please reload this page.
jasnell commented Dec 1, 2019
I'm wondering whether there should be a warning printed at runtime when the node.js process starts. |
nodejs-github-bot commented Dec 1, 2019
tniessen left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM as an experimental build feature.
nodejs-github-bot commented Dec 8, 2019
nodejs-github-bot commented Dec 9, 2019
mcollina commented Dec 9, 2019
@nodejs/build @nodejs/testing I would need some help here, as tests that seems unrelated are failing, however this should not change the default config. |
nodejs-github-bot commented Dec 10, 2019
BridgeAR commented Dec 10, 2019
@mcollina we currently rarely have green builds. There are lots of infrastructure failures and flaky tests. That's what seemed to have happened here as well. |
nodejs-github-bot commented Dec 10, 2019 • edited by Trott
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by Trott
Uh oh!
There was an error while loading. Please reload this page.
Trott commented Dec 12, 2019
Landed in 086c7b4 |
The --experimental-enable-pointer-compression is experimental as it breaks ABI compatibility. PR-URL: nodejs#30463 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
The --experimental-enable-pointer-compression is experimental as it breaks ABI compatibility. PR-URL: #30463 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Rich Trott <[email protected]>
mmarchini commented Feb 21, 2020
@targos any concerns on backporting this to diff --git a/common.gypi b/common.gypi index 8c9076b735..856c6aa6ff 100644 --- a/common.gypi+++ b/common.gypi@@ -339,6 +339,12 @@ }], ], }], + ['v8_enable_pointer_compression == 1',{+ 'defines': ['V8_COMPRESS_POINTERS'],+ }],+ ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1',{+ 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],+ }], ['OS == "win"',{'defines': [ 'WIN32',The changes are non-intrusive, since it only impacts builds using |
tuananh commented Feb 23, 2020
where can i download a built version with |
mhdawson commented Feb 24, 2020
@tuananh I believe you have to build it yourself as it is not in any of the shipping binaries. |
richardlau commented Jun 1, 2020
If this does get backported it will need to land with #33688 to fix building addons. |
mmarchini commented Jun 2, 2020
Probably not worth it. We have pointer compressions builds for v14 now, and the pointer compression implementation on v12 has bugs as well as performance issues. |
`common.gypi` is used by `node-gyp` to compile addons. Default values must be provided for variables that may not exist on older versions of Node.js so that older versions of Node.js can be used to compile addons for later versions of Node.js. Add default values for `v8_enable_pointer_compression` and `v8_enable_31bit_smis_on_64bit_arch`. PR-URL: nodejs#33688 Refs: nodejs#30463 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Signed-off-by: Richard Lau <[email protected]>
`common.gypi` is used by `node-gyp` to compile addons. Default values must be provided for variables that may not exist on older versions of Node.js so that older versions of Node.js can be used to compile addons for later versions of Node.js. Add default values for `v8_enable_pointer_compression` and `v8_enable_31bit_smis_on_64bit_arch`. PR-URL: #33688 Refs: #30463 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Signed-off-by: Richard Lau <[email protected]>
`common.gypi` is used by `node-gyp` to compile addons. Default values must be provided for variables that may not exist on older versions of Node.js so that older versions of Node.js can be used to compile addons for later versions of Node.js. Add default values for `v8_enable_pointer_compression` and `v8_enable_31bit_smis_on_64bit_arch`. PR-URL: #33688 Refs: #30463 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Signed-off-by: Richard Lau <[email protected]>
`common.gypi` is used by `node-gyp` to compile addons. Default values must be provided for variables that may not exist on older versions of Node.js so that older versions of Node.js can be used to compile addons for later versions of Node.js. Add default values for `v8_enable_pointer_compression` and `v8_enable_31bit_smis_on_64bit_arch`. PR-URL: #33688 Refs: #30463 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Signed-off-by: Richard Lau <[email protected]>
jdmarshall commented Feb 12, 2023
Why wouldn’t this be useful now that we’re on node 18? |
This PR adds support for building node with pointer compression enabled. From some preliminary tests, enabling pointer compression shrinks memory usage by 40%.
See: #26756
Note that building with this flag makes some of our addon tests fail:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes