Snapshots

67 views
Skip to first unread message

Chris Strom

unread,
Mar 5, 2012, 4:28:32 PM3/5/12
to General Dart Discussion
I have seen references to improving Dart startup time with snapshots,
but have not found any specific details. Is this still an
experimental feature or is it possible to play with it somehow?

-Chris

Seth Ladd

unread,
Mar 6, 2012, 2:33:08 AM3/6/12
to Chris Strom, General Dart Discussion, Vijay Menon
+ Vijay

Snapshots is a VM feature, and Dartium has snapshots support now. I've CC'ed Vijay who might be able to add some details.

Chris Strom

unread,
Mar 6, 2012, 7:29:39 AM3/6/12
to Seth Ladd, General Dart Discussion, Vijay Menon
I am very interested in playing with client app snapshots -- if
they're possible at this time. Any pointers would be appreciated :)

Anton Muhin

unread,
Mar 6, 2012, 7:53:20 AM3/6/12
to Chris Strom, Seth Ladd, General Dart Discussion, Vijay Menon
Sure, Chris.

Take a look at http://src.chromium.org/viewvc/multivm/trunk/webkit/Source/WebCore/bindings/dart/DartApplicationLoader.cpp?revision=188&view=markup

There is isSnapshottingEnabled which for now always return false. If
you change it to return true, it will cache an application on the
first load and following loads of the application in the same renderer
process would lead to load of the application from the snapshot. It's
easy to see from resource loading view in DevTools. You can also
instrument (applying http://codereview.chromium.org/9260001) Dartium
with special tracing of application loading.

Last time we experimented with it, we've got pretty encouraging results.

You can even cache a snapshot on the disk if you pass
--enable-preparsed-js-caching flag to Dartium (name is misnomer).

Please note that it's all experimental features and cache expiration
is a tricky matter. And I would strongly recommend using clean user
data dir playing with those switches.

yours,
anton.

Chris Strom

unread,
Mar 6, 2012, 9:25:39 AM3/6/12
to Anton Muhin, Seth Ladd, General Dart Discussion, Vijay Menon
Anton,

Awesome, thanks!

Can more than one client use the same snapshot? I believe that I saw
that these are stateless snapshots, in which case it would seem like
this is potentially possible -- even if there are no facilities for
doing it right now.

Thanks again for the pointers - much appreciated!

-Chris

Anton Muhin

unread,
Mar 6, 2012, 9:28:03 AM3/6/12
to Chris Strom, Seth Ladd, General Dart Discussion, Vijay Menon
Glad you like it :)

What do you mean by client? Technically we just cache snapshots like
a content of URL gets cached which means ever party which can access
this cache, will benefit from snapshotting. If you only enable
snapshotting, that should be all the tabs which share the same
renderer process. If you provide this preparsed data flag, data would
be cached persistently and any instance of Dartium would be able to
get the snapshot.

yours,
anton.

Reply all
Reply to author
Forward
0 new messages