perf: reduce prebuilt binary size - #415
Merged
Merged
Conversation
Overall package sizeSelf size: 2.61 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | pprof-format | 2.3.1 | 504.33 kB | 504.33 kB | | source-map | 0.8.0 | 185.66 kB | 185.66 kB | | node-gyp-build | 4.8.4 | 13.86 kB | 13.86 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
IlyasShabi
marked this pull request as ready for review
September 17, 2026 12:15
IlyasShabi
requested review from
nsavoire,
r1viollet and
szegedi
as code owners
September 17, 2026 12:15
szegedi
previously approved these changes
Sep 17, 2026
| 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', | ||
| 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden | ||
| 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', | ||
| 'DEAD_CODE_STRIPPING': 'YES', # -dead_strip |
There was a problem hiding this comment.
Out of curiosity, can we know what dead code is being stripped away? There might be an opportunity to throw it out of source code as well. Of course, if it's not globally dead code but just code that's inactive in particular targets then that's obviously a different story…
Author
There was a problem hiding this comment.
Well keeping the flag is about now and later:
- the last commit removes the one dead signature it surfaced and the rest is the case you guessed (NAN header templates).
- It means any dead code we introduce stops shipping in the binaries automatically.
szegedi
approved these changes
Sep 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?:
Adds size reduction flags to
binding.gypin order to drop debug info, hide symbol visibility, and enable dead-code stripping.The symbol table is deliberately kept so crash reports still show function names. Only the export table shrinks, which nothing reads at runtime. Sanitizer builds are excluded.
Motivation:
prebuilds/is 15.5 MB of the package's size, and every dd-trace-js user downloads it. A chunk of that is debug info and exported symbols nothing uses.