[v8-users] mksnapshot and warm_up

2018-03-01 Thread Johannes Rieken

Hey, 

Can someone help me understand what the difference between a warm and cold 
snapshot is? I stumbled over `WarmUpSnapshotDataBlob` but I am not entirely 
sure how to make use of them via the mksnapshot-tools and what the sequence 
would be. Do I begin with a custom snapshot and then snapshot that snapshot 
again after its functions have been used?

Thanks, 
Joh

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] mksnapshot and warm_up

2018-03-01 Thread 'Jakob Gruber' via v8-users
On Thu, Mar 1, 2018 at 4:43 PM, Johannes Rieken 
wrote:

>
> Hey,
>
> Can someone help me understand what the difference between a warm and cold
> snapshot is? I stumbled over `WarmUpSnapshotDataBlob` but I am not
> entirely sure how to make use of them via the mksnapshot-tools and what the
> sequence would be. Do I begin with a custom snapshot and then snapshot that
> snapshot again after its functions have been used?
>
>
Yes. See
https://cs.chromium.org/chromium/src/v8/src/snapshot/mksnapshot.cc?l=177&rcl=fd158bc49d646d93a59cd07d07dfb9627bc94a30
for an example.

The steps are also nicely explained here:
https://cs.chromium.org/chromium/src/v8/src/api.cc?l=830&rcl=fd158bc49d646d93a59cd07d07dfb9627bc94a30

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] mksnapshot and warm_up

2018-03-01 Thread Johannes Rieken
Great! Thanks for the speedy reply. Looking 
at 
https://cs.chromium.org/chromium/src/v8/test/cctest/test-serialize.cc?type=cs&q=CustomSnapshotDataBlobWithWarmup&l=1167
 
makes me think/hope  that functions are being compiled but state isn't 
changed (e.g. the assignment to `a` isn't persistent). Is that a correct 
assumption?

On Thursday, March 1, 2018 at 5:16:37 PM UTC+1, Jakob Gruber wrote:
>
> On Thu, Mar 1, 2018 at 4:43 PM, Johannes Rieken  > wrote:
>
>>
>> Hey, 
>>
>> Can someone help me understand what the difference between a warm and 
>> cold snapshot is? I stumbled over `WarmUpSnapshotDataBlob` but I am not 
>> entirely sure how to make use of them via the mksnapshot-tools and what the 
>> sequence would be. Do I begin with a custom snapshot and then snapshot that 
>> snapshot again after its functions have been used?
>>
>>
> Yes. See 
> https://cs.chromium.org/chromium/src/v8/src/snapshot/mksnapshot.cc?l=177&rcl=fd158bc49d646d93a59cd07d07dfb9627bc94a30
>  
> for an example.
>
> The steps are also nicely explained here:
>
> https://cs.chromium.org/chromium/src/v8/src/api.cc?l=830&rcl=fd158bc49d646d93a59cd07d07dfb9627bc94a30
>  
>

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [v8-users] mksnapshot and warm_up

2018-03-01 Thread ramonpf1950

Thanks for emailing me! No, I haven’t been hacked :)

I signed up for a spam filtering service called BitBounce. To deliver your 
email to my inbox, please click the link below. Thanks!

https://bitbounce.com/pay_bitbounce_fee/332072661

BitBounce is a product by:

Turing Technology, Inc.
BitBounce.com
Redwood City, CA

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] mksnapshot and warm_up

2018-03-01 Thread 'Jakob Gruber' via v8-users
AFAIK that's correct. The polluted warmup context is thrown out, and a
second clean context (with the now-compiled code) is serialized into the
warmed up snapshot.

On Thu, Mar 1, 2018 at 5:31 PM, Johannes Rieken 
wrote:

> Great! Thanks for the speedy reply. Looking at https://cs.chromium.org/
> chromium/src/v8/test/cctest/test-serialize.cc?type=cs&q=
> CustomSnapshotDataBlobWithWarmup&l=1167 makes me think/hope  that
> functions are being compiled but state isn't changed (e.g. the assignment
> to `a` isn't persistent). Is that a correct assumption?
>
> On Thursday, March 1, 2018 at 5:16:37 PM UTC+1, Jakob Gruber wrote:
>>
>> On Thu, Mar 1, 2018 at 4:43 PM, Johannes Rieken 
>> wrote:
>>
>>>
>>> Hey,
>>>
>>> Can someone help me understand what the difference between a warm and
>>> cold snapshot is? I stumbled over `WarmUpSnapshotDataBlob` but I am not
>>> entirely sure how to make use of them via the mksnapshot-tools and what the
>>> sequence would be. Do I begin with a custom snapshot and then snapshot that
>>> snapshot again after its functions have been used?
>>>
>>>
>> Yes. See https://cs.chromium.org/chromium/src/v8/src/snapshot/mks
>> napshot.cc?l=177&rcl=fd158bc49d646d93a59cd07d07dfb9627bc94a30 for an
>> example.
>>
>> The steps are also nicely explained here:
>> https://cs.chromium.org/chromium/src/v8/src/api.cc?l=830&;
>> rcl=fd158bc49d646d93a59cd07d07dfb9627bc94a30
>>
> --
> --
> v8-users mailing list
> v8-users@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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Jakob Gruber

Software Engineer

jgru...@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.

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[v8-users] Profiling: what is "LoadIC: A load IC from the snapshot"?

2018-03-01 Thread Andrew Wilcox
My prof output starts off with

 [JavaScript]:
   ticks  total  nonlib   name
  12065   22.7%   22.7%  LoadIC: A load IC from the snapshot
   27325.1%5.1%  Builtin: StrictEqual

and I was wondering, can anyone tell me what LoadIC is?

Thanks!

Andrew

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re: [v8-users] mksnapshot and warm_up

2018-03-01 Thread ramonpf1950

Thanks for emailing me! No, I haven’t been hacked :)

I signed up for a spam filtering service called BitBounce. To deliver your 
email to my inbox, please click the link below. Thanks!

https://bitbounce.com/pay_bitbounce_fee/4119332566

BitBounce is a product by:

Turing Technology, Inc.
BitBounce.com
Redwood City, CA

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Profiling: what is "LoadIC: A load IC from the snapshot"?

2018-03-01 Thread Jakob Kummerow
The thing that handles property loads (like foo.bar;).

Seeing it take 22% is rare. Is your app heavy on polymorphic property loads?


On Thu, Mar 1, 2018 at 9:44 AM Andrew Wilcox 
wrote:

> My prof output starts off with
>
>  [JavaScript]:
>ticks  total  nonlib   name
>   12065   22.7%   22.7%  LoadIC: A load IC from the snapshot
>27325.1%5.1%  Builtin: StrictEqual
>
> and I was wondering, can anyone tell me what LoadIC is?
>
> Thanks!
>
> Andrew
>
> --
> --
> v8-users mailing list
> v8-users@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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Profiling: what is "LoadIC: A load IC from the snapshot"?

2018-03-01 Thread Andrew Wilcox

>
> can anyone tell me what LoadIC is?
>
>  

> The thing that handles property loads (like foo.bar;).


Thank you Jacob!
 

Seeing it take 22% is rare. Is your app heavy on polymorphic property loads?

 
Yes, I'm writing an interpreter and it was doing a *lot* of instanceof 
checks.  Since I don't have undefined or null values in my interpreter, 
rather than use x instanceof Foo I can instead give Foo instances a "type" 
property of e.g. 100 and use x.type === 100, which is faster.  So indeed 
yes, now it's doing a lot of polymorphic property loads! :-)  Makes perfect 
sense, thanks!

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Profiling: what is "LoadIC: A load IC from the snapshot"?

2018-03-01 Thread Jakob Kummerow
Depending on usage patterns, you might see a further speed boost if you
split your objects into two parts, where one has the same shape for all
objects and the other is type dependent, roughly:

class Thing {
  constructor(type, specific, ...) {
this.type = type;
this.other_common_field = ...;

// If type === 100, this is a Foo; if type === 101, it's a Bar; etc.
this.type_specific_stuff = specific;
  }
}

var x = new Thing(100, new Foo(...), ...);  // Maybe wrap in a factory?

if (x.type === 100) {
  var data = x.type_specific_stuff.foo_field;  // Both loads are
monomorphic, yay!
}



On Thu, Mar 1, 2018 at 12:31 PM Andrew Wilcox 
wrote:

> can anyone tell me what LoadIC is?
>>
>>
>
>> The thing that handles property loads (like foo.bar;).
>
>
> Thank you Jacob!
>
>
> Seeing it take 22% is rare. Is your app heavy on polymorphic property
>> loads?
>
>
> Yes, I'm writing an interpreter and it was doing a *lot* of instanceof
> checks.  Since I don't have undefined or null values in my interpreter,
> rather than use x instanceof Foo I can instead give Foo instances a
> "type" property of e.g. 100 and use x.type === 100, which is faster.  So
> indeed yes, now it's doing a lot of polymorphic property loads! :-)  Makes
> perfect sense, thanks!
>
> --
> --
> v8-users mailing list
> v8-users@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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Profiling: what is "LoadIC: A load IC from the snapshot"?

2018-03-01 Thread Andrew Wilcox

>
> Depending on usage patterns, you might see a further speed boost if you 
> split your objects into two parts, where one has the same shape for all 
> objects and the other is type dependent
>

Oh interesting idea!  Thanks!

-- 
-- 
v8-users mailing list
v8-users@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.