`applyCoverage` takes ~1.5 seconds per invocation on sourcemaps for a relatively small React app
envgap__istanbuljs__v8-to-istanbul-159
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- The project already builds and runs before the fix, so there is nothing to repair.
02 / ENVIRONMENT RECIPE
- Base commit
168dc1e2dd5f9833e2b49f0d8c0c53175b5a6a28- Manifest
package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
istanbuljs/v8-to-istanbul #159 · read the original issue
https://github.com/istanbuljs/v8-to-istanbul/blob/591126b102244465b27906cdb8cdb82df1f4e760/lib/source.js#L78-L80 I've narrowed it down to this loop, which ends up iterating ~50000 lines per call ~20000 times in total, or about a billion iterations for my input set. The 20000 figure is split between four separate invocations of `applyCoverage`, each of which end up taking between 1 and 2 seconds. I've attached a CPU profile: [CPU.20210704.110252.82278.0.001.cpuprofile.zip](https://github.com/istanbuljs/v8-to-istanbul/files/6760457/CPU.20210704.110252.82278.0.001.cpuprofile.zip) And here are the dependencies of this sample app, most of which aren't related to the generated bundle: https://github.com/JustinChristensen/react-sample-app/blob/816a26a266ba7d4c7ec5febdb98aa9c4d7e05fa8/package.json The 50000 figure above seems to correspond with the number of lines of the bundle generated by webpack for my sample app (an unminified build).
04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]