Commit 205295a
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 <rewq5991@gmail.com>
PR-URL: #63675
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>shouldSkipFileCoverage result per URL1 parent e7513a8 commit 205295a
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
534 | 535 | | |
535 | 536 | | |
536 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
537 | 546 | | |
538 | 547 | | |
539 | 548 | | |
| |||
0 commit comments