Hi Etienne,

Thanks for working on this! I am looking forward to using the new API.

At least for concurrent marking use case, the overhead of the virtual call
in ShouldYield will be small because we will call it after marking a
group of objects (~O(1ms)).
The reason is that for yielding we need to do additional work, like
flushing the thread-local segments of the marking worklist. That work has
to be amortized.

So the straightforward solution with virtual functions is okay for GC and I
don't see an alternative to that.

There is another V8 specific caveat: we need to accommodate for V8
embedders that do not implement the new Jobs API.
So either we need a simple default implementation for the new API on top of
the existing runner in v8::Platform.
Or each place in V8 that wants to use the new Job API has to check if the
platform supports it and correctly fallback to the old task API.

Cheers,
Ulan.

On Wed, Oct 9, 2019 at 12:35 PM 'Clemens Backes' via v8-dev <
v8-dev@googlegroups.com> wrote:

> Hi Etienne,
>
> I just want to express my excitement about this new API! It looks like
> exactly what we need for WebAssembly compilation (and tier-up). We can
> probably remove quite a few hacks when switching to the Jobs API.
>
> So thanks a lot for implementing this!
>
> I am not an API or platform expert, so I cannot help with the original
> question :/
>
> Cheers,
> Clemens
>
> On Tue, Oct 8, 2019 at 7:32 PM 'Etienne Pierre-doray' via v8-dev <
> v8-dev@googlegroups.com> wrote:
>
>> TL;DR: Jobs API
>> <https://docs.google.com/document/d/15VnxSzaf2jXCyEiqJaeM5u1Rr6HoMuiI0qwUtuX2cOQ/edit>
>> will be exposed publicly in base/task/post_job.h in this CL
>> <https://chromium-review.googlesource.com/c/chromium/src/+/1829916>
>>
>> The Jobs API is a power user API, mostly intended for v8, to be able to
>> schedule a single base::RepeatingCallback and request that ThreadPool
>> workers invoke it concurrently. This avoids degenerate cases which occur
>> when many components post “num cores” tasks and the scheduler lacks
>> context. The API also supports yield-semantics so user-visible job can use
>> all cores but get out of the way when a user-blocking job comes in.
>>
>> ... and it's ready!
>>
>> However, I'm not sure how to go about exposing the API in v8::Platform.
>> Similar to v8::TaskRunner, the straightforward solution is to replicate
>> classes (JobHandle, JobDelegate) with virtual interfaces and further
>> extend v8::Platform to expose PostJob(). This adds overhead however,
>> especially for JobDelegate::ShouldYield() which should be called very
>> often.
>> I'd like to get input from v8 folks, and see if there are other solutions
>> I haven't considered.
>>
>> --
>> --
>> v8-dev mailing list
>> v8-dev@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.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/v8-dev/CALoDvsboGKxjaYWfjcaEnu8U8XbRK_zi8auaTQ3y74-8L155%3Dg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/v8-dev/CALoDvsboGKxjaYWfjcaEnu8U8XbRK_zi8auaTQ3y74-8L155%3Dg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
>
> Clemens Backes
>
> (né Hammacher)
>
> Software Engineer
>
> cleme...@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-dev mailing list
> v8-dev@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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-dev/CAGO%3DqhD0cxC94G-3ZQAsGTME_NqNSi1NuUUUgxC9b19jDsmtyg%40mail.gmail.com
> <https://groups.google.com/d/msgid/v8-dev/CAGO%3DqhD0cxC94G-3ZQAsGTME_NqNSi1NuUUUgxC9b19jDsmtyg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
v8-dev mailing list
v8-dev@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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CABNJt2Lmsqin56T8Y6X1dTWvhaAiti8f-zwxAU6yV8YkowVD2Q%40mail.gmail.com.

Reply via email to