Hello everyone,
It’s been a while since we provided chromium-dev@ with an update on the //base/task APIs. Lots has happened since the migration to TaskScheduler days :). For one, in case you missed it, TaskScheduler was renamed to ThreadPool.
News:
base::test::TaskEnvironment is finally feature complete (MOCK_TIME everywhere, yay!).
New documentation for Testing Components Which Post Tasks.
The PostTask API is now available in Java too.
Work in progress:
Jobs API. 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.
Browser UI Thread Scheduler is live and there’s work in progress to take advantage of it on startup.
C++ Promises. Impl is in progress. Discussing with chrome-eng-review to determine how much functionality we want to expose in the initial API. (If you know of use cases that need Reject/Catch semantics we’d like to hear them).
Featured:
Enhanced the ThreadPool configuration to be able to share threads between blocking and non-blocking tasks. This enabled Script Streaming improvements that yielded: 3% on time-to-interactive @ 99th percentile, reduced main-thread stall time waiting for script compilation by 5-20%, and most importantly resulted in a 25% improvement in time-to-shakira. Congrats leszeks@ and v8 team for extracting such amazing results from better scheduling :).
Reduced UI thread jank by 6X on Windows and 48X on Mac [1] thanks to analysis of traces from Slow Reports w/ Sampling Profiler.
Stay up to date:
We added base/task/README.md which most importantly links to our living Vision for Task APIs.
Subscribe to schedu...@chromium.org to observe or get involved in the design discussions.