Closed Bug 1173588 Opened 7 years ago Closed 2 months ago
.profile/End can easily be blocked and fail
When calling console.profile/profileEnd between long running JS, or back to back, or even with a small delay, it seems that `console.profile()` hits possibly at the same time as `console.profileEnd()`, which results in starting the profile AFTER the time range, meaning profileEnd will never be found, so the console profile recording will go on indefinitely. Can easily recreate this or use the sourcemaps benchmark which will do it. This scenarios work in chrome's profiler. Scenarios where this will fail: 0: console.profile(); console.profileEnd(); 1: console.profile() <long running js> console.profileEnd() 2: console.profile() <long running js or nothing at all> setTimeout(() => console.profileEnd(), 0);  https://github.com/mozilla/source-map/blob/master/bench/bench.html
On my machine ( 2013 MBAir, 10.10, latest dev edition w/e10s ), 5ms seems to be the minimum eg console.profile(); setTimeout(() => console.profileEnd(), 5); Anything less ( run from scratchpad ) and I need to re-run the second line to end the profile. I wish console.profile returned a handle that had ( once the profile was up and running ) an end() method.
Triaging. Filter on ADRENOCORTICOTROPIC (yes).
Priority: -- → P2
Version: 41 Branch → unspecified
Duping to bug 1240249, as this is the same undelying issue.
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.