Open Bug 1173588 Opened 6 years ago Updated 3 years ago

console.profile/End can easily be blocked and fail

Categories

(DevTools :: Performance Tools (Profiler/Timeline), defect, P2)

defect

Tracking

(firefox41 affected)

Tracking Status
firefox41 --- affected

People

(Reporter: jsantell, Unassigned)

References

(Blocks 2 open bugs)

Details

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[0] 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);


[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.
See Also: → 1173923
Depends on: 1172180
Triaging. Filter on ADRENOCORTICOTROPIC (yes).
Priority: -- → P2
Version: 41 Branch → unspecified
Duplicate of this bug: 1173923
Blocks: perf-bug
Product: Firefox → DevTools
Duping to bug 1240249, as this is the same undelying issue.
You need to log in before you can comment on or make changes to this bug.