Re: [v8-users] Is there a way out from dictionary mode?

2018-02-14 Thread Jakob Kummerow
>
> I think I understand what you mean. Dictionary mode is faster when you
> want to use your object like a dictionary.
>

More generally, dictionary mode is faster for adding/removing/reconfiguring
properties (and, depending on circumstances, sometimes also for
reading/writing existing properties at high-degree polymorphic sites).


> However, if I were to delete a property of some important prototype lots
> of objects use, I'm guessing that would cause performance issues in the
> whole application.
>

*Modifying* prototypes in any way *can* have a widespread performance
impact, especially when it's done in the middle of execution. Depending on
circumstances, deleting a prototype's property might not be worse than
other modifications to that prototype. (Fun fact: we *currently *(there are
plans to change this) keep prototypes (almost) always in non-dictionary
mode, but modifying them is slow regardless.)


> On Thursday, February 15, 2018 at 12:01:55 AM UTC+2, Jakob Kummerow wrote:
>>
>> Probably not. There are exceptions, but I'm hesitating to be specific
>> because these are internal implementation details that can and will change
>> over time.
>>
>> Also, "fast" is relative. Dictionary mode exists because it is faster for
>> some operations. Shape-tracked objects are faster for other situations. For
>> complex use cases, it can be difficult to estimate which mode works better.
>>
>>
>> On Wed, Feb 14, 2018 at 12:47 PM Greg Rosenbaum 
>> wrote:
>>
>>> I understand that I delete an object from a property, i.e.:
>>>
>>> delete obj.property
>>>
>>> It will enter dictionary mode. If I do this only once, and the object is
>>> used throughout the application, will it at some point become fast again?
>>>
>>> --
>>> --
>>> 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+u...@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.


Re: [v8-users] Is there a way out from dictionary mode?

2018-02-14 Thread Greg Rosenbaum
Thanks for the reply!

I think I understand what you mean. Dictionary mode is faster when you want 
to use your object like a dictionary.

However, if I were to delete a property of some important prototype lots of 
objects use, I'm guessing that would cause performance issues in the whole 
application.


On Thursday, February 15, 2018 at 12:01:55 AM UTC+2, Jakob Kummerow wrote:
>
> Probably not. There are exceptions, but I'm hesitating to be specific 
> because these are internal implementation details that can and will change 
> over time.
>
> Also, "fast" is relative. Dictionary mode exists because it is faster for 
> some operations. Shape-tracked objects are faster for other situations. For 
> complex use cases, it can be difficult to estimate which mode works better.
>
>
> On Wed, Feb 14, 2018 at 12:47 PM Greg Rosenbaum  > wrote:
>
>> I understand that I delete an object from a property, i.e.:
>>
>> delete obj.property
>>
>> It will enter dictionary mode. If I do this only once, and the object is 
>> used throughout the application, will it at some point become fast again?
>>
>> -- 
>> -- 
>> 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+u...@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] Is there a way out from dictionary mode?

2018-02-14 Thread Jakob Kummerow
Probably not. There are exceptions, but I'm hesitating to be specific
because these are internal implementation details that can and will change
over time.

Also, "fast" is relative. Dictionary mode exists because it is faster for
some operations. Shape-tracked objects are faster for other situations. For
complex use cases, it can be difficult to estimate which mode works better.


On Wed, Feb 14, 2018 at 12:47 PM Greg Rosenbaum 
wrote:

> I understand that I delete an object from a property, i.e.:
>
> delete obj.property
>
> It will enter dictionary mode. If I do this only once, and the object is
> used throughout the application, will it at some point become fast again?
>
> --
> --
> 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] Is there a way out from dictionary mode?

2018-02-14 Thread Greg Rosenbaum
I understand that I delete an object from a property, i.e.:

delete obj.property

It will enter dictionary mode. If I do this only once, and the object is 
used throughout the application, will it at some point become fast again?

-- 
-- 
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] Cached data or startup snapshot?

2018-02-14 Thread Alexandru Dima
Hi,

Which one would you recommend we (VSCode) use?

Today, we are using cached data, but I wanted to find out if a startup 
snapshot would help us more. I've crammed all of VSCode's source code 
(except third party node modules) in a file and I've created a startup 
snapshot using `mksnapshot`. I would have thought that the startup snapshot 
would beat the current cached data usage on startup speed by a long shot...

I was surprised to see that all of the time gains of using a startup 
snapshot (~200-300ms of code loading) is lost and then some while creating 
the UI (DOM and stuff...). It looks to me like the code that lives in the 
startup snapshot is fundamentally slower (50% or 100% slower), and that 
perhaps it does not use inlining? (see the deep stack traces below).


1. Before (using cached data)

https://github.com/Microsoft/vscode/files/1724876/snapshot-before.cpuprofile.txt
https://user-images.githubusercontent.com/5047891/36215842-80a615a2-11ad-11e8-9efc-2d0f2e533e07.png





2. After (using startup snapshot)
https://github.com/Microsoft/vscode/files/1724877/snapshot-after.cpuprofile.txt
https://user-images.githubusercontent.com/5047891/36216039-fcd8aa18-11ad-11e8-9bd4-fe4f1add9546.png




Is this expected? Cached data is always faster than startup snapshot?

We are on an oldish version of v8 (5.8.283.38), as we're using Electron 
1.7.9. 

Thanks,
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.