Skip to content
This repository has been archived by the owner on May 23, 2021. It is now read-only.

Compile Node.js with -Os flag #14

Open
sr229 opened this issue Jun 22, 2019 · 2 comments
Open

Compile Node.js with -Os flag #14

sr229 opened this issue Jun 22, 2019 · 2 comments

Comments

@sr229
Copy link
Contributor

sr229 commented Jun 22, 2019

According to nodejs/node#19, it seems that its possible to make Node.js more memory efficient by swapping -O3 to -Os. As @bnoordhuis stated:

There is an --optimize_for_size flag in newer versions of node and you can limit the size of the heap with --max_old_space_size=... (and --max_semi_space_size and --max_executable_size) in all versions.

You can also tweak common.gypi to build at -Os instead of -O3. The smaller binary, besides using less memory, also tends to run faster on systems with small L1 code caches.

Therefore this should compliment ARM support because most ARM boards are very memory-limited.

@deansheather
Copy link
Member

What's the catch? Slower performance on regular computers?

@sr229
Copy link
Contributor Author

sr229 commented Jun 24, 2019

@deansheather it should be more faster with larger L1 caches so I think we can go with this route.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants