Improve performance using LTO and disabling asserts #1922
Merged
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.
This PR will need also this electron-npg-automator PR
Compile differences in Release mode:
Before:
cc -o Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o ../vendor/libgit2/src/allocators/failalloc.c '-DNODE_GYP_MODULE_NAME=libgit2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DGIT_THREADS' '-DGIT_SSH' '-DGIT_SSH_MEMORY_CREDENTIALS' '-DLIBGIT2_NO_FEATURES_H' '-DGIT_SHA1_COLLISIONDETECT' '-DGIT_USE_NSEC' '-DGIT_HTTPS' '-DSRC_UTIL_H_' '-DGIT_ARCH_64' '-DGIT_NTLM' '-DGIT_GSSAPI' '-DGIT_REGEX_BUILTIN' '-DGIT_OPENSSL' '-DGIT_USE_FUTIMENS' '-DGIT_USE_STAT_MTIM' '-DHTTP_PARSER_STRICT=0' -I/home/julian/.cache/node-gyp/13.6.7/include/node -I/home/julian/.cache/node-gyp/13.6.7/src -I/home/julian/.cache/node-gyp/13.6.7/deps/openssl/config -I/home/julian/.cache/node-gyp/13.6.7/deps/openssl/openssl/include -I/home/julian/.cache/node-gyp/13.6.7/deps/uv/include -I/home/julian/.cache/node-gyp/13.6.7/deps/zlib -I/home/julian/.cache/node-gyp/13.6.7/deps/v8/include -I../vendor/libgit2/include -I../vendor/libgit2/src -I../vendor/libgit2/deps/ntlmclient -I../vendor/libgit2/deps/pcre -I../vendor/libgit2/deps/zlib -I../vendor/http_parser -I../vendor/libssh2/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -Wno-missing-field-initializers -Wno-unused-variable -Wno-deprecated-declarations -O3 -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o.d.raw -c
After:
cc -o Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o ../vendor/libgit2/src/allocators/failalloc.c '-DNODE_GYP_MODULE_NAME=libgit2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DV8_COMPRESS_POINTERS' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-DV8_REVERSE_JSARGS' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DGIT_THREADS' '-DGIT_SSH' '-DGIT_SSH_MEMORY_CREDENTIALS' '-DLIBGIT2_NO_FEATURES_H' '-DGIT_SHA1_COLLISIONDETECT' '-DGIT_USE_NSEC' '-DGIT_HTTPS' '-DSRC_UTIL_H_' '-DGIT_ARCH_64' '-DGIT_NTLM' '-DGIT_GSSAPI' '-DGIT_REGEX_BUILTIN' '-DGIT_OPENSSL' '-DGIT_USE_FUTIMENS' '-DGIT_USE_STAT_MTIM' '-DHTTP_PARSER_STRICT=0' '-DNDEBUG' -I/home/julian/.cache/node-gyp/13.6.7/include/node -I/home/julian/.cache/node-gyp/13.6.7/src -I/home/julian/.cache/node-gyp/13.6.7/deps/openssl/config -I/home/julian/.cache/node-gyp/13.6.7/deps/openssl/openssl/include -I/home/julian/.cache/node-gyp/13.6.7/deps/uv/include -I/home/julian/.cache/node-gyp/13.6.7/deps/zlib -I/home/julian/.cache/node-gyp/13.6.7/deps/v8/include -I../vendor/libgit2/include -I../vendor/libgit2/src -I../vendor/libgit2/deps/ntlmclient -I../vendor/libgit2/deps/pcre -I../vendor/libgit2/deps/zlib -I../vendor/http_parser -I../vendor/libssh2/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -Wno-missing-field-initializers -Wno-unused-variable -Wno-deprecated-declarations -flto -O3 -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o.d.raw -c
Notice new
-flto
and-DNDEBUG
optionsBefore:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\CL.exe /c /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\include\node" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\src" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\openssl\config" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\openssl\openssl\include" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\uv\include" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\zlib" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\v8\include" /Z7 /nologo /W3 /WX- /diagnostics:column /MP1 /Ox /Ob2 /Oi /Ot /Oy /D NODE_GYP_MODULE_NAME=pcre /D USING_UV_SHARED=1 /D USING_V8_SHARED=1 /D V8_DEPRECATION_WARNINGS=1 /D V8_DEPRECATION_WARNINGS /D V8_IMMINENT_DEPRECATION_WARNINGS /D V8_COMPRESS_POINTERS /D V8_31BIT_SMIS_ON_64BIT_ARCH /D V8_REVERSE_JSARGS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _HAS_EXCEPTIONS=0 /D OPENSSL_NO_PINSHARED /D OPENSSL_THREADS /D OPENSSL_NO_ASM /D HAVE_SYS_STAT_H /D HAVE_SYS_TYPES_H /D HAVE_WINDOWS_H /D HAVE_STDINT_H /D HAVE_INTTYPES_H /D HAVE_MEMMOVE /D HAVE_STRERROR /D HAVE_STRTOLL /D HAVE__STRTOI64 /D SUPPORT_PCRE8 /D NO_RECURSE /D HAVE_LONG_LONG /D HAVE_UNSIGNED_LONG_LONG /D NEWLINE=10 /D POSIX_MALLOC_THRESHOLD=10 /D LINK_SIZE=2 /D PARENS_NEST_LIMIT=250 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D PCREGREP_BUFSIZE /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D "HOST_BINARY=\"node.exe\"" /GF /Gm- /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR- /Fo"Release\obj\pcre\\vendor\libgit2\deps\pcre\pcre_byte_order.obj" /Fd"C:\Proyectos\nodegit\build\Release\pcre.pdb" /external:W3 /Gd /TC /wd4351 /wd4355 /wd4800 /wd4251 /wd4275 /wd4244 /wd4267 /FC /errorReport:queue ..\..\vendor\libgit2\deps\pcre\pcre_byte_order .c
After:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\HostX64\x64\CL.exe /c /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\include\node" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\src" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\openssl\config" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\openssl\openssl\include" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\uv\include" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\zlib" /I"C:\Users\Julian\AppData\Local\node-gyp\Cache\13.6.7\deps\v8\include" /Z7 /nologo /W3 /WX- /diagnostics:column /MP1 /Ox /Ob2 /Oi /Ot /Oy /GL /D NODE_GYP_MODULE_NAME=pcre /D USING_UV_SHARED=1 /D USING_V8_SHARED=1 /D V8_DEPRECATION_WARNINGS=1 /D V8_DEPRECATION_WARNINGS /D V8_IMMINENT_DEPRECATION_WARNINGS /D V8_COMPRESS_POINTERS /D V8_31BIT_SMIS_ON_64BIT_ARCH /D V8_REVERSE_JSARGS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _HAS_EXCEPTIONS=0 /D OPENSSL_NO_PINSHARED /D OPENSSL_THREADS /D OPENSSL_NO_ASM /D HAVE_SYS_STAT_H /D HAVE_SYS_TYPES_H /D HAVE_WINDOWS_H /D HAVE_STDINT_H /D HAVE_INTTYPES_H /D HAVE_MEMMOVE /D HAVE_STRERROR /D HAVE_STRTOLL /D HAVE__STRTOI64 /D SUPPORT_PCRE8 /D NO_RECURSE /D HAVE_LONG_LONG /D HAVE_UNSIGNED_LONG_LONG /D NEWLINE=10 /D POSIX_MALLOC_THRESHOLD=10 /D LINK_SIZE=2 /D PARENS_NEST_LIMIT=250 /D MATCH_LIMIT=10000000 /D MATCH_LIMIT_RECURSION=10000000 /D PCREGREP_BUFSIZE /D MAX_NAME_SIZE=32 /D MAX_NAME_COUNT=10000 /D "HOST_BINARY=\"node.exe\"" /D NDEBUG /GF /Gm- /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR- /Fo"Release\obj\pcre\\vendor\libgit2\deps\pcre\pcre_byte_order.obj" /Fd"C:\Proyectos\nodegit\build\Release\pcre.pdb" /external:W3 /Gd /TC /wd4351 /wd4355 /wd4800 /wd4251 /wd4275 /wd4244 /wd4267 /FC /errorReport:queue ..\..\vendor\libgit2\deps\pcre\pcre_byte_order .c
Notice new
/GL
and/D NDEBUG
optionsBefore:
cc -o Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o ../vendor/libgit2/src/allocators/failalloc.c '-DNODE_GYP_MODULE_NAME=libgit2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DGIT_THREADS' '-DGIT_SSH' '-DGIT_SSH_MEMORY_CREDENTIALS' '-DLIBGIT2_NO_FEATURES_H' '-DGIT_SHA1_COLLISIONDETECT' '-DGIT_USE_NSEC' '-DGIT_HTTPS' '-DSRC_UTIL_H_' '-DGIT_ARCH_64' '-DGIT_SECURE_TRANSPORT' '-DGIT_USE_STAT_MTIMESPEC' '-DGIT_REGEX_REGCOMP_L' '-DGIT_USE_ICONV' '-DGIT_NTLM' '-DGIT_GSSAPI' '-DHTTP_PARSER_STRICT=0' -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/include/node -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/src -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/openssl/config -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/openssl/openssl/include -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/uv/include -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/zlib -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/v8/include -I../vendor/libgit2/include -I../vendor/libgit2/src -I../vendor/libgit2/deps/ntlmclient -I../vendor/libgit2/deps/zlib -I../vendor/http_parser -I../vendor/libssh2/include -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-variable -Wno-deprecated-declarations -Wno-uninitialized -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o.d.raw -c
After:
cc -o Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o ../vendor/libgit2/src/allocators/failalloc.c '-DNODE_GYP_MODULE_NAME=libgit2' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DGIT_THREADS' '-DGIT_SSH' '-DGIT_SSH_MEMORY_CREDENTIALS' '-DLIBGIT2_NO_FEATURES_H' '-DGIT_SHA1_COLLISIONDETECT' '-DGIT_USE_NSEC' '-DGIT_HTTPS' '-DSRC_UTIL_H_' '-DGIT_ARCH_64' '-DGIT_SECURE_TRANSPORT' '-DGIT_USE_STAT_MTIMESPEC' '-DGIT_REGEX_REGCOMP_L' '-DGIT_USE_ICONV' '-DGIT_NTLM' '-DGIT_GSSAPI' '-DHTTP_PARSER_STRICT=0' '-DNDEBUG' -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/include/node -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/src -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/openssl/config -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/openssl/openssl/include -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/uv/include -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/zlib -I/Users/julianmesa/Library/Caches/node-gyp/14.19.0/deps/v8/include -I../vendor/libgit2/include -I../vendor/libgit2/src -I../vendor/libgit2/deps/ntlmclient -I../vendor/libgit2/deps/zlib -I../vendor/http_parser -I../vendor/libssh2/include -O3 -gdwarf-2 -flto -mmacosx-version-min=10.13 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-variable -Wno-deprecated-declarations -Wno-uninitialized -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/libgit2/vendor/libgit2/src/allocators/failalloc.o.d.raw -c
Notice new
-flto
and-DNDEBUG
options