From 6645447da201c93371791dd0b41a7d7ec83db514 Mon Sep 17 00:00:00 2001 From: ishabi Date: Wed, 16 Sep 2026 17:43:45 +0200 Subject: [PATCH 1/2] perf: reduce prebuilt binary size --- binding.gyp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/binding.gyp b/binding.gyp index 8b918472..c264af5c 100644 --- a/binding.gyp +++ b/binding.gyp @@ -109,6 +109,30 @@ }, } ], + ["address_sanitizer != 'true' and thread_sanitizer != 'true'", { + 'xcode_settings': { + 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', + 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden + 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES', + 'DEAD_CODE_STRIPPING': 'YES', # -dead_strip + }, + "conditions": [ + ["OS == 'linux'", { + "cflags": [ + "-fvisibility=hidden", + "-ffunction-sections", + "-fdata-sections", + ], + "cflags_cc": ["-fvisibility-inlines-hidden"], + "ldflags": [ "-Wl,--gc-sections" ], + }], + ["OS == 'win'", { + 'msvs_settings': { + 'VCLinkerTool': { 'OptimizeReferences': 2 }, # /OPT:REF + }, + }], + ], + }], ["address_sanitizer == 'true' and OS == 'mac'", { 'xcode_settings': { 'OTHER_CFLAGS+': [ From 8c394ef88ca18a71d231b4841b96b97355b29230 Mon Sep 17 00:00:00 2001 From: ishabi Date: Fri, 18 Sep 2026 12:02:26 +0200 Subject: [PATCH 2/2] remove dead code --- bindings/translate-heap-profile.cc | 5 ----- bindings/translate-heap-profile.hh | 2 -- 2 files changed, 7 deletions(-) diff --git a/bindings/translate-heap-profile.cc b/bindings/translate-heap-profile.cc index bd97d549..ad4ed0e0 100644 --- a/bindings/translate-heap-profile.cc +++ b/bindings/translate-heap-profile.cc @@ -170,11 +170,6 @@ std::shared_ptr TranslateAllocationProfileToCpp( return new_node; } -v8::Local TranslateAllocationProfile( - v8::AllocationProfile::Node* node) { - return HeapProfileTranslator().TranslateAllocationProfile(node); -} - v8::Local TranslateAllocationProfile( v8::AllocationProfile::Node* node, const AllocationProfileNodeStatsMap* allocation_stats) { diff --git a/bindings/translate-heap-profile.hh b/bindings/translate-heap-profile.hh index e62f14f4..502c9195 100644 --- a/bindings/translate-heap-profile.hh +++ b/bindings/translate-heap-profile.hh @@ -41,8 +41,6 @@ std::shared_ptr TranslateAllocationProfileToCpp( v8::AllocationProfile::Node* node); v8::Local TranslateAllocationProfile(Node* node); -v8::Local TranslateAllocationProfile( - v8::AllocationProfile::Node* node); v8::Local TranslateAllocationProfile( v8::AllocationProfile::Node* node, const AllocationProfileNodeStatsMap* allocation_stats);