V8_base.lib (compiled as part of node.js) is huuuuge. What for?

When executing vcbuild.bat Release , I will get the lib directory as follows:

 $ ls -1Ssh Release/lib/ total 303M 263M v8_base.lib 22M openssl.lib 7.2M v8_snapshot.lib 6.2M v8_nosnapshot.lib 4.8M uv.lib 480K zlib.lib 88K http_parser.lib 

Debugging is much better, but still:

 $ ls -1Ssh Debug/lib/ total 102M 83M v8_base.lib 14M openssl.lib 2.1M uv.lib 1.6M v8_snapshot.lib 1.3M v8_nosnapshot.lib 352K zlib.lib 80K http_parser.lib 

Two things that I don’t understand about all this:

  • Why is the V8 THIS big?
  • Why does the Debug assembly produce much smaller lib files?

I am on Windows 7 64bit.

Edit I just realized that the default value of target_arch is ia32 , not x64 , regardless of the architecture of the host architecture. Thus, the numbers above refer to the 32-bit assembly. 64-bit numbers are slightly larger (309M / 128M).

+4
source share
3 answers

Why is the V8 THIS big?

Perhaps this is due to its dependencies and features? How:

 $ ls -1Ssh Release/obj/v8_base/|head -15 total 264M 5.1M hydrogen.obj 4.7M objects.obj 4.6M lithium-codegen-ia32.obj 4.4M lithium-ia32.obj 4.3M runtime.obj 4.3M hydrogen-instructions.obj 4.2M lithium-allocator.obj 4.1M lithium-gap-resolver-ia32.obj 3.7M compiler.obj 3.7M isolate.obj 3.5M v8.obj 3.4M lithium.obj 3.3M heap.obj 3.3M api.obj 

However, it seems a bit big ...

Why does the Debug assembly produce much smaller lib files?

Perhaps this is a speed optimization that I found in common.gypi ?

  'Release': { ... 'msvs_settings': { 'VCCLCompilerTool': { 'RuntimeLibrary': 0, # static release 'Optimization': 3, # /Ox, full optimization 'FavorSizeOrSpeed': 1, # /Ot, favour speed over size 'InlineFunctionExpansion': 2, # /Ob2, inline anything eligible 
+3
source

It's time to understand why the V8 engine builds such large builds on Windows.

There is an option -D "component = shared", which you can use when creating V8 to create a smaller lib v8.lib (~ 250kb), and for dll you need V8.dll (~ 12mb), icui18n.dll (~ 2.5 mb), icuuc.dll (~ 1.5mb).

 From the V8 Directory: third_party\python_26\python.exe build\gyp_v8 -G msvs_version=2010 -Dtarget_arch=x64 -D"component=shared" -G 
+2
source

The real answer is that you did not select the "release" option. The division mode significantly reduces the size.

-2
source

All Articles