-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Pointer compression and Node modules #26756
Comments
So, if we enable this at build time, there’s no way for people to exceed that limit? I would guess that some currently set a larger
Are both modes going to stay around for a while, or is it more of a thing where V8 would say e.g. if pointer compression works out well then the non-pointer-compressed mode is going to go away? |
Are there any docs explaining what pointer compression is/how it works? |
Also: Per Isolate or per process? |
I'm not sure whether there is a public design doc. The principle is that as long as you limit your address space to 2^32 = 4GB, 32 bits are enough to address that whole address space, if you have a fixed base address to compute the full 64 bits. That address space would be per isolate. There are some tricks we could employ, to increase the address space, e.g. by aligning to 4 bytes (which we already do) and shifting by 2 bits, effectively addressing 16GB, or aligning to 8 bytes I would expect for the foreseeable future to have both build modes. |
What would be the deciding factor for moving completely to the new mode?Would there be any risk that V8 would switch before we have validation that the new mode works for all necessary Node.js use cases? |
I'd veto a V8 change that would break any reasonable Node.js use case. |
Does this significantly benefit Node.js environments, i.e. should we consider turning it on when ready? |
IMO, pros:
|
All very valid points. Although regarding performance: our hope is that pointer compression will pay for itself due to fewer cache misses. |
We use |
I can definitely see definite benefit to having this option but not on by default, or even on in our distribution builds. |
Agree with @jasnell and others, turning on by default on major platforms sounds like a regression, at least until issues with performance and supporting increasing the heap size are dealt with. It might make sense for some new platforms, like iOS, where memory is not expected to be plentiful. |
We use |
I also agree that the limit of 4G means it is probably not viable for Node.js in the short term. Being able to build wi the option to experiment and compare does seem useful though. We might even want a CI job to regularly build/test with it. |
I can see some embedded devices leveraging this feature, as well as servers if the cache hit ratio prediction holds up. @hashseed is there any chance this could become a runtime flag in the future (like |
Not sure whether that's technically viable. Certainly being considered though. |
Compressed pointers should have no effect between those add-ons in N-API, the N-API runtime should take the difference itself. |
Note as i don't see it in this issue yet; the design doc can be found here |
@mcollina @nodejs/v8 ... where are we at on this? |
It's not enabled by default. The unofficial build can be found here: https://github.com/nodejs/unofficial-builds/tree/master/recipes/x64-pointer-compression. |
There's an issue on nodejs/tsc with more comprehensive information and discussion on pointer compression, I believe this issue can be closed. |
V8 is fairly close to reaching a state where we can enable pointer compression. It will be a build time flag for the embedder to enable. Implications are:
Discuss!
The text was updated successfully, but these errors were encountered: