Skip to content

Use 64-bit floats for call tree timings.#5371

Merged
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-qyswoppmowyu
Feb 14, 2025
Merged

Use 64-bit floats for call tree timings.#5371
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-qyswoppmowyu

Conversation

@mstange

@mstange mstange commented Feb 14, 2025

Copy link
Copy Markdown
Contributor

Fixes #5310.

This matches the precision of regular JavaScript numbers. 32-bit floats don't have enough precision to exactly represent integers larger than 16,777,216. So they don't have sufficient precision for the call tree which sometimes is used to with bytes values which can range in the gigabytes.

@mstange mstange requested a review from julienw February 14, 2025 04:45
@mstange mstange self-assigned this Feb 14, 2025
@codecov

codecov Bot commented Feb 14, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.96%. Comparing base (d8bba23) to head (a820532).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5371   +/-   ##
=======================================
  Coverage   85.96%   85.96%           
=======================================
  Files         312      312           
  Lines       30331    30331           
  Branches     8295     8295           
=======================================
  Hits        26073    26073           
  Misses       3661     3661           
  Partials      597      597           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@julienw julienw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

});
});

it('computes correct numbers when using large weights', function () {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the added test!

Fixes firefox-devtools#5310.

This matches the precision of regular JavaScript numbers.
32-bit floats don't have enough precision to exactly represent
integers larger than 16,777,216. So they don't have sufficient
precision for the call tree which sometimes is used to with
bytes values which can range in the gigabytes.
@mstange mstange enabled auto-merge February 14, 2025 15:49
@mstange mstange merged commit 1ae7b16 into firefox-devtools:main Feb 14, 2025
@canova canova mentioned this pull request Feb 19, 2025
canova added a commit that referenced this pull request Feb 19, 2025
## Updates:

[Nicolas Chevobbe] Make timeline ruler notches visible in High Contrast
Mode (#5346)
[Nazım Can Altınova] Add the ability to mark marker fields as hidden
(#5354)
[Maxx Crawford] Update guide-startup-shutdown.md (#5357)
[Nazım Can Altınova] Enable prettier on the docs-user markdown files
(#5358)
[Paul Adenot] Allow searching by Content-Type in the network marker view
(#5351)
[Florian Quèze] Hide the pid in global tracks if it is 0. (#5361)
[Markus Stange] Make inverting the call tree fast, by computing inverted
call nodes lazily (#4900)
[Markus Stange] Use 64-bit floats for call tree timings. (#5371)
[Markus Stange] Extend the workaround in the v53 upgrader to generate
missing subcategory columns. (#5369)

## Also thanks to our localizers:

de: Michael Köhler
el: Jim Spentzos
en-GB: Paul
es-CL: ravmn
fr: Théo Chevalier
fur: Fabio Tomat
fy-NL: Fjoerfoks
ia: Melo46
it: Francesco Lodolo
nl: Mark Heijl
pt-BR: Marcelo Ghelman
ru: Valery Ledovskoy
sv-SE: Luna Jernberg, Andreas Pettersson
tr: Grk
uk: Іhor Hordiichuk
zh-CN: Olvcpr423
zh-TW: Pin-guang Chen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Float32Array has insufficient precision in call tree timings - incorrect byte sums displayed in call tree

2 participants