Commit c048b3a
test_runner: cache
`shouldSkipFileCoverage(url)` is invoked twice for every covered
script (once during source-map mapping and once during merge), and
the same script URL is typically reported by every worker. The
result depends only on `options.cwd`, `coverageExcludeGlobs`, and
`coverageIncludeGlobs`, all of which are fixed for the lifetime of
a TestCoverage instance, so the URL -> boolean mapping is
deterministic and safe to cache.
Add a private `#skipCache` SafeMap and split the method into a thin
caching wrapper plus a private `#computeShouldSkipFileCoverage`
that holds the original logic. Callers are unchanged.
This eliminates redundant glob and URL parsing work proportional to
the number of workers x scripts in the coverage report.
Refs: #55103
Signed-off-by: sangwook <[email protected]>
PR-URL: #63675
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chemi Atlow <[email protected]>shouldSkipFileCoverage result per URL1 parent cb46741 commit c048b3a
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
538 | 547 | | |
539 | 548 | | |
540 | 549 | | |
| |||
0 commit comments