firefox-devtools / firefox-devtools/profiler

If CPU deltas are given as times (as opposed to cycle counts), 100% CPU should be based on cpuDelta == timeDelta, independently of the largest observed delta

Open
#3,716 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
491
Avg merge
3d 5h
Merged PRs (30d)
30

Description

If CPU deltas are given in microseconds, but all samples have cpuDelta < sampleTimeDelta, then we display incorrect CPU percentages: We make it look like the CPU usage was higher than it actually was, by making the "largest observed CPU usage" 100%, even if it wasn't 100%.

Profile with 50% CPU usage throughout the entire profile: https://share.firefox.dev/3IjJO76

Expected results: We should display 50% CPU.
Actual results: We display 100% CPU.

Profile with 50% CPU usage through most of the profile, and a 100% sample at the end: https://share.firefox.dev/3Gee8OG
This one actually displays 50%.

I generated these profiles with [this Rust program](https://gist.github.com/mstange/c1c2b61442b165f28fa0384e9eab820b).

┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-476)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.