Commit c733d82d authored by danakj's avatar danakj Committed by Commit Bot

Speed up generation of the set of virtual web platform tests.

On the bots, we see phantom time being lost during startup of the
webkit_layout_tests step on each swarming bot. Looking at the logs
from https://bugs.chromium.org/p/chromium/issues/detail?id=982208#c0
we see 25-40s of lost time after "Manifest generation completed".

I narrowed down the majority of this time to be spent inside
_wpt_test_urls_matching_paths(). This method was called 213 times,
once for each virtual test suite, and iterates through multiple
WPT dirs, and then over 30k test paths from the WPT manifest files.

The inner loops of this process was doing far more work than they
needed to do.

We change _all_virtual_tests() to pass a set of virtual test paths
to _wpt_test_urls_matching_paths(), calling it a single time. This
allows us to generate and load the WPT manifests a single time instead
of hundreds of times, saving about 4 seconds of time on my local
machine.

We then re-order the nesting of the loops and move work that needs
to be done to the outer-most loop based on the inputs it depends on.
And we simplify the matching done inside the inner-most loop to a
single string.startswith() call. This saves another 9 seconds of time
on my local machine.

Locally this takes this phantom time from about 14 seconds down to 2
seconds. As the bots have larger phantom time (25-40 seconds) we can
expect to see a larger proportional win there:

On linux-rel we see the phantom time after generating WPT manifests
drop from 19 to 4 seconds (-15 seconds) and on
win10_chromium_x64_rel_ng we see the phantom time drop from 23 to 5
seconds (-18 seconds).

Overall this is reducing the post-manifest phantom time by about
80% (about 20s -> 4s).
It is reducing total time to first test by about 20% (about
90s -> 70s).

R=dpranke@chromium.org

Bug: 982208
Change-Id: Ibb8d6287e456f0910ee43f80e8072743d21bc2f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1903725
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713922}
parent 6ad53382
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment