Re: [v8-users] Microoptimizing message handling

2019-04-23 Thread Ben Noordhuis
On Fri, Apr 19, 2019 at 9:16 AM J Decker  wrote:
>
> A question came to mind about the resolution of the 'compilation' of code.. I 
> have message handlers that receive an object with a standard field 'op'.  
> Then for each 'op' that can be processed I have an if test and a small amount 
> of code to handle the message (either inline or calling a function).
>
> Would it be better to call a function for each message handler, or is the 
> code within the if block consider a specific type of message?
> Given that there is time lost to just calling a function and creating its 
> closure too...

V8 emits ICs (inline caches) inside the if block. IOW, the simple
solution should be best. :-)

-- 
-- 
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] Microoptimizing message handling

2019-04-23 Thread Jakob Kummerow
Optimized compilation happens on a per-function basis. A large function
with many branches (if/else or switch), some of which are only executed
rarely, tends to cause repeated deoptimizations (some branches have been
executed enough to make the function hot, it gets optimized, then one of
the as-yet unexecuted branches is hit the first time, causing a deopt;
repeat). *If* you are running into that issue (you'll have to measure),
then moving *every handler* out into its own function *could* indeed help
(you'll have to measure). There's also always a chance that it doesn't
matter in practice (i.e. the difference shows up in a microbenchmark or
with tracing tools, but is not measurable in your real app).

On Tue, Apr 23, 2019 at 12:45 PM Ben Noordhuis  wrote:

> On Fri, Apr 19, 2019 at 9:16 AM J Decker  wrote:
> >
> > A question came to mind about the resolution of the 'compilation' of
> code.. I have message handlers that receive an object with a standard field
> 'op'.  Then for each 'op' that can be processed I have an if test and a
> small amount of code to handle the message (either inline or calling a
> function).
> >
> > Would it be better to call a function for each message handler, or is
> the code within the if block consider a specific type of message?
> > Given that there is time lost to just calling a function and creating
> its closure too...
>
> V8 emits ICs (inline caches) inside the if block. IOW, the simple
> solution should be best. :-)
>
> --
> --
> 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] Intent to Ship: Promise.allSettled

2019-04-23 Thread Sathya Gunasekaran
Contact Emails:
gsat...@chromium.org

Spec:
https://tc39.github.io/proposal-promise-allSettled/

Summary:
Promise.allSettled returns a promise that is fulfilled with an array
of promise state snapshots, but only after all the original promises
have settled, i.e. become either fulfilled or rejected.

Interoperability and compatibility risk:
This stage 3 proposal introduces a new static method on the Promise
constructor. There is very low compat risk.

Firefox: In development
Safari: No signals
Edge: No signals

Is this feature fully tested?
Yes, this feature passes V8's own mjsunit tests as well as all the
test262 tests.

Tracking bug:
https://bugs.chromium.org/p/v8/issues/detail?id=9060

Link to entry on the Chrome Platform Status dashboard
https://www.chromestatus.com/feature/5547381053456384

Requesting approval to ship?
Yes. Note that since this is a V8/JS feature, this post is just an FYI
to blink-dev — no sign off from Blink API owners is required.

-- 
-- 
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] Re: [v8-dev] Intent to Ship: Promise.allSettled

2019-04-23 Thread Adam Klein
LGTM!

On Tue, Apr 23, 2019 at 4:19 PM Sathya Gunasekaran 
wrote:

> Contact Emails:
> gsat...@chromium.org
>
> Spec:
> https://tc39.github.io/proposal-promise-allSettled/
>
> Summary:
> Promise.allSettled returns a promise that is fulfilled with an array
> of promise state snapshots, but only after all the original promises
> have settled, i.e. become either fulfilled or rejected.
>
> Interoperability and compatibility risk:
> This stage 3 proposal introduces a new static method on the Promise
> constructor. There is very low compat risk.
>
> Firefox: In development
> Safari: No signals
> Edge: No signals
>
> Is this feature fully tested?
> Yes, this feature passes V8's own mjsunit tests as well as all the
> test262 tests.
>
> Tracking bug:
> https://bugs.chromium.org/p/v8/issues/detail?id=9060
>
> Link to entry on the Chrome Platform Status dashboard
> https://www.chromestatus.com/feature/5547381053456384
>
> Requesting approval to ship?
> Yes. Note that since this is a V8/JS feature, this post is just an FYI
> to blink-dev — no sign off from Blink API owners is required.
>
> --
> --
> v8-dev mailing list
> v8-...@googlegroups.com
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-dev+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] Re: [v8-dev] Intent to Ship: Promise.allSettled

2019-04-23 Thread 'Mathias Bynens' via v8-users
LGTM

On Wed, Apr 24, 2019 at 6:01 AM 'Benedikt Meurer' via v8-dev <
v8-...@googlegroups.com> wrote:

> LGTM!
>
> On Wed, Apr 24, 2019, 02:05 Adam Klein  wrote:
>
>> LGTM!
>>
>> On Tue, Apr 23, 2019 at 4:19 PM Sathya Gunasekaran 
>> wrote:
>>
>>> Contact Emails:
>>> gsat...@chromium.org
>>>
>>> Spec:
>>> https://tc39.github.io/proposal-promise-allSettled/
>>>
>>> Summary:
>>> Promise.allSettled returns a promise that is fulfilled with an array
>>> of promise state snapshots, but only after all the original promises
>>> have settled, i.e. become either fulfilled or rejected.
>>>
>>> Interoperability and compatibility risk:
>>> This stage 3 proposal introduces a new static method on the Promise
>>> constructor. There is very low compat risk.
>>>
>>> Firefox: In development
>>> Safari: No signals
>>> Edge: No signals
>>>
>>> Is this feature fully tested?
>>> Yes, this feature passes V8's own mjsunit tests as well as all the
>>> test262 tests.
>>>
>>> Tracking bug:
>>> https://bugs.chromium.org/p/v8/issues/detail?id=9060
>>>
>>> Link to entry on the Chrome Platform Status dashboard
>>> https://www.chromestatus.com/feature/5547381053456384
>>>
>>> Requesting approval to ship?
>>> Yes. Note that since this is a V8/JS feature, this post is just an FYI
>>> to blink-dev — no sign off from Blink API owners is required.
>>>
>>> --
>>> --
>>> v8-dev mailing list
>>> v8-...@googlegroups.com
>>> http://groups.google.com/group/v8-dev
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "v8-dev" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to v8-dev+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-dev mailing list
> v8-...@googlegroups.com
> http://groups.google.com/group/v8-dev
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-dev+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.