[v8-users] Re: Cached data or startup snapshot?

2018-02-23 Thread Alexandru Dima
Hi Yang,

I have spent quite some time to create a repro that executes the exact same 
code in the exact same state, once with the code loaded from cached data, 
and once with the code running from a startup snapshot. 

In this standalone repro, the total time is indeed better for starting from 
a startup snapshot (column 2), but note that executing the startup code 
(blue) is 27% slower when the same code executes with the same state from a 
startup snapshot:




The repro is at https://github.com/alexandrudima/v8-repro and I would 
appreciate if you can please take a look. The README there contains all the 
steps needed to set it up.

Here are some specific answers in blue:


> When you say classes run slower, do you mean they take longer to execute, 
or do you mean they spend time on compilation too?
I mean the code takes longer to execute, I use Date.now() before and after 
executing the code.

> Does your non-snapshotted version use proxies too? Proxies are indeed 
significantly slower.
This makes a lot of sense. I have removed the usage of proxies, such that 
both versions have the exact same code.

> You should no longer need --ignition --turbo. This is the default with 
the newest V8.
> What version of V8 are you using?
The one that comes with Electron 1.7.9, v8 version 5.8.283.38

> It's not expected that code in the snapshot is slower than code at 
runtime. But I expect that there is no code embedded in the snapshot in the 
first place.
I'm sorry, I don't understand what you mean. The startup snapshot contains 
the source code inside of it (see index2.html in the repro where no code 
loading is needed, as the code is part of the startup snapshot).

> Do you have a small repro I can play with? E.g. source to include in the 
snapshot and the code to run. Ideally pure JS that I can run in Node.
See https://github.com/alexandrudima/v8-repro
I'm sorry, the repro is not small and it involves running Electron, as the 
source code which reproduces needs electron to execute. I have tried to 
load only a subset of the code (some editor text buffer and stress it out 
by doing large text operations), but I could not reproduce the same 
slowdown in that case. If you can guide me through it, I can try to reduce 
the repro, but I don't know what I'm looking for. Everything is slower, 
there is not one particular section of code that is slower.

P.S. If you uncomment the link tag in the html files, this is what the code 
is doing:




Thank you,
Alex

>

-- 
-- 
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] --print-code does not work

2018-02-23 Thread Jakob Kummerow
Correction: Looking at the code, it turns out that --print-code still does
what the name implies: it prints all code (optimized code, regexp code,
wasm code). It's just that there is no unoptimized code any more (which
arguably was the flag's primary use case in the past).


On Mon, Feb 12, 2018 at 1:45 AM 'Mathias Bynens' via v8-users <
v8-users@googlegroups.com> wrote:

> Tracking issue for the removal of --print-code:
> https://bugs.chromium.org/p/v8/issues/detail?id=7437
>
> On Fri, Feb 9, 2018 at 11:22 PM, Jakob Kummerow 
> wrote:
>
>> If --print-opt-code prints nothing, then probably your function isn't
>> getting optimized. Try calling it more often.
>>
>> --print-code is "technically correct" in the sense that it prints all of
>> the unoptimized machine code that V8 doesn't generate any more ;-)
>> (We should remove the flag.)
>>
>>
>> On Fri, Feb 9, 2018 at 1:18 AM Istvan Tabanyi 
>> wrote:
>>
>>> Hi,
>>>
>>> I compiled v8 from sources successfully, but
>>> --print-code/--print-opt-code gives me no output at all.
>>> --print-bytecode works fine, --print-all-code prints something, but the
>>> actual code is definitely not in the output(Created a simple function with
>>> unique name, called in a loop, grepped for it and nothing)
>>>
>>> Tried release and debug builds, also with custom options like this:
>>> gn gen out.gn/x64.debug --args='is_debug=true target_cpu="x64"
>>> v8_target_cpu="x64" v8_enable_disassembler=true'
>>>
>>> I tried to look for tutorials on this topic, but most of it really
>>> outdated and using make/gyp.
>>> Can someone give me some tips about this? And sorry if this is not the
>>> right place to ask questions like this.
>>>
>>> --
>>> --
>>> 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.
>>
>
> --
> --
> 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.