Query regarding file size of snaphot_blob.bin

49 views
Skip to first unread message

uzair....@samsung.com

unread,
Dec 14, 2017, 1:22:54 AM12/14/17
to v8-users

Hi All,

We found that there is an increase in size of snapshot_blob.bin in Chromium M56(~994KB) compared to Chromium M47(~514KB).

Please can you let us know the following

1) How is snapshot_blob.bin generated at compile time ? (If possible where in chromium code )

2) Is it possible to reduce the size of snapshot_blob.bin ? (if yes where in chromium code do we do it and will it have any performance regression ?)

I am newbie to V8 and it would be great if you could provide some feed back regarding above queries. :)

Thanks

Ben Noordhuis

unread,
Dec 14, 2017, 4:14:15 AM12/14/17
to v8-users
On Thu, Dec 14, 2017 at 7:22 AM, <uzair....@samsung.com> wrote:
> 1) How is snapshot_blob.bin generated at compile time ? (If possible where
> in chromium code )

Look for a file called mksnapshot.cc in v8/src/snapshot.

> 2) Is it possible to reduce the size of snapshot_blob.bin ? (if yes where in
> chromium code do we do it and will it have any performance regression ?)

You could disable internationalization (v8_enable_i18n_support=0) but
that's about it. It won't affect performance but the Intl JS object
will have only bare-bones functionality.

You can disable the snapshot entirely (v8_use_snapshot=0) but that
does have a performance impact because it shifts the cost of
construction to Context::New(). Expect that function to slow down by
5-10x.

Jakob Gruber

unread,
Dec 14, 2017, 4:37:43 AM12/14/17
to v8-u...@googlegroups.com
We've actually been working on reducing memory overhead around the snapshot,
see the lazy builtins design doc at http://goo.gl/dxkYDZ. Note though that this is
intended to reduce runtime memory use, not the size of the snapshot blob itself. I'd
expect the snapshot blob to grow further in the future.

As Ben says below, it's possible to build V8 without a snapshot, but startup costs will
increase significantly.

May I ask what your main concern is? Runtime memory consumption or binary size?

uzair....@samsung.com

unread,
Dec 14, 2017, 4:39:51 AM12/14/17
to v8-users
Hi Ben,

Thanks for the reply :)

We disabled  v8_enable_i18n_support and size of snapshot_blob.bin has reduced by 20KB.

But is there any way to find out the reason for increase ?


Thanks

uzair....@samsung.com

unread,
Dec 14, 2017, 4:43:08 AM12/14/17
to v8-users
Hi Jakob,

Our current aim is to reduce the size of binary.

Thanks

Jakob Gruber

unread,
Dec 14, 2017, 4:54:36 AM12/14/17
to v8-u...@googlegroups.com
There's a bunch of reasons, but mainly: 

* new functionality (both internal and new language additions);
* and the increasing use of CodeStubAssembler to write shipped code (vs. implementing builtins
  as self-hosted JS, shipping the source files and compiling at runtime).

Our current aim is to reduce the size of binary.

I suppose this is the binary in decompressed form, and not something like an APK? It'd theoretically
be possible to support loading from compressed snapshot blobs (for roughly 1MB savings), but this
is not implemented currently.

uzair....@samsung.com

unread,
Dec 18, 2017, 12:20:54 AM12/18/17
to v8-users
Hi Jakob

Thanks for the reply :)


>* new functionality (both internal and new language additions);

    Is it possible to find out what new functionality has been added?( If yes please can you let me know where to check for new features added ?)

Thanks

Jakob Gruber

unread,
Dec 18, 2017, 2:24:34 AM12/18/17
to v8-u...@googlegroups.com
On Mon, Dec 18, 2017 at 6:20 AM, <uzair....@samsung.com> wrote:
>* new functionality (both internal and new language additions);

    Is it possible to find out what new functionality has been added?( If yes please can you let me know where to check for new features added ?)

For new language features, you could watch https://github.com/tc39/proposals to track TC39 proposal status. New V8 developments are sometimes called out on the V8 blog, but the only way to get a complete picture is to follow the git commit log.
 
--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jakob Gruber

Software Engineer

jgr...@google.com

Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

uzair....@samsung.com

unread,
Dec 19, 2017, 1:25:05 AM12/19/17
to v8-users
Hi Jakob,

We were comparing v8/src/builtins.h file of Chromium M47 and Chromium M56 and found that there many new (>100) builtin functions added in Chromium 56.

Do you think this could be one of the major reasons for increase in size of Snapshot_blob.bin file ?

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Jakob Gruber

unread,
Dec 19, 2017, 3:42:25 AM12/19/17
to v8-u...@googlegroups.com
On Tue, Dec 19, 2017 at 7:25 AM, <uzair....@samsung.com> wrote:
Hi Jakob,

We were comparing v8/src/builtins.h file of Chromium M47 and Chromium M56 and found that there many new (>100) builtin functions added in Chromium 56.

Do you think this could be one of the major reasons for increase in size of Snapshot_blob.bin file ?

Yes I assume that's where most of the growth comes from. To verify, you can print stats about snapshot contents with

out/release/mksnapshot --serialization_statistics

And builtin sizes with (doesn't exist yet in 47):

out/release/mksnapshot --print-builtin-size  
 
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages