| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
There was a problem hiding this comment.
This needs a good story for our addon ABI
Sorry, something went wrong.
|
Electron feels similarly - the memory savings are positive especially considering they're per-isolate but we're concerned about ABI compat of native modules |
Sorry, something went wrong.
|
@gabrielschulhof can you confirm n-api can handle this case? |
Sorry, something went wrong.
@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. |
Sorry, something went wrong.
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)? |
Sorry, something went wrong.
|
Definite +1 on marking this experimental and documenting the impact on native addons. Assuming those changes, this LGTM |
Sorry, something went wrong.
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. |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
would be good to enable so we can at least start playing with it
Sorry, something went wrong.
Sorry, something went wrong.
|
I've removed the config from common.gypi. Please review. cc @targos |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
I'm wondering whether there should be a warning printed at runtime when the node.js process starts. |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM as an experimental build feature.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
Sorry, something went wrong.
|
@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. |
Sorry, something went wrong.
Sorry, something went wrong.
The --experimental-enable-pointer-compression is experimental as it breaks ABI compatibility. PR-URL: nodejs#30463 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
The --experimental-enable-pointer-compression is experimental as it breaks ABI compatibility. PR-URL: #30463 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
|
@targos any concerns on backporting this to v12.x? I was testing it today, and if we add the following lines (pulled from dda658c) to common.gypi, it works: 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 --experimental-enable-pointer-compression. I can send a PR to backport it, unless there are other concerns. |
Sorry, something went wrong.
|
where can i download a built version with --experimental-enable-pointer-compression enabled? |
Sorry, something went wrong.
|
@tuananh I believe you have to build it yourself as it is not in any of the shipping binaries. |
Sorry, something went wrong.
If this does get backported it will need to land with #33688 to fix building addons. |
Sorry, something went wrong.
|
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. |
Sorry, something went wrong.
`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 <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com>
`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 <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com>
`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 <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com>
`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 <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Signed-off-by: Richard Lau <riclau@uk.ibm.com>
|
Why wouldn’t this be useful now that we’re on node 18? |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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