Skip to content

Typed arrays + flags for the FuncTable - #6323

Merged
mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-nuxnmrnvulqk
Sep 18, 2026
Merged

mstange merged 1 commit into
firefox-devtools:mainfrom
mstange:push-nuxnmrnvulqk

Conversation

@mstange

@mstange mstange commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Main | Deploy preview

Similar to what #6173 did for the frame table, but for the func table.

@mstange
mstange requested a review from canova September 16, 2026 19:14
@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.95349% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.03%. Comparing base (a99dca0) to head (a8970fd).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-query/index.ts 0.00% 10 Missing ⚠️
src/components/shared/CallNodeContextMenu.tsx 58.82% 7 Missing ⚠️
src/components/tooltip/CallNode.tsx 42.85% 4 Missing ⚠️
src/profile-logic/sanitize.ts 81.81% 4 Missing ⚠️
src/node-tools/profiler-edit.ts 0.00% 2 Missing ⚠️
src/profile-logic/symbolication.ts 90.90% 2 Missing ⚠️
src/profile-query/function-list.ts 60.00% 2 Missing ⚠️
src/actions/profile-view.ts 50.00% 1 Missing ⚠️
src/profile-logic/insert-stack-labels.ts 88.88% 1 Missing ⚠️
src/profile-logic/line-timings.ts 94.73% 1 Missing ⚠️
... and 4 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6323      +/-   ##
==========================================
+ Coverage   83.92%   84.03%   +0.11%     
==========================================
  Files         353      354       +1     
  Lines       37969    38100     +131     
  Branches    10604    10662      +58     
==========================================
+ Hits        31865    32018     +153     
+ Misses       5675     5654      -21     
+ Partials      429      428       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mstange
mstange force-pushed the push-nuxnmrnvulqk branch 2 times, most recently from 2de6033 to 7684dd5 Compare September 17, 2026 19:01

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

I see that this line still checks for source !== null which is always going to be true now:
https://github.com/mstange/perf.html/blob/7684dd5a8a9ff3ff7daa898d2ae37050fcca6f33/src/node-tools/profiler-edit.ts#L127-L128
We need to also change it to flag based checks.

I think this is more of a nit, but it might be also good to add an early return for this:
https://github.com/mstange/perf.html/blob/7684dd5a8a9ff3ff7daa898d2ae37050fcca6f33/src/actions/profile-view.ts#L2098-L2099
Technically it's a bug if we are here at this point with an invalid resource, so ideally it should never happen but previously we were doing a ensureExists which throws, now we will silently collapse the first resource.

- `1 << 4` — `HasLine`: `lineNumber[i]` is meaningful.
- `1 << 5` — `HasColumn`: `columnNumber[i]` is meaningful.
- `1 << 6` — `HasOriginalLocation`: `originalLocation[i]` is meaningful.
- The `isJS` and `relevantForJS` boolean columns were removed; the `IsJS` and `RelevantForJS` flag bits carry that information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

resource[i] !== null &&
resource[i] !== undefined
) {
f |= 1 << 2;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: would be nice to have constants that are defined in this upgrader for all the flags like HasResource etc.

Comment thread src/profile-logic/symbolication.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Probably should use flags here too instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

Comment on lines +1767 to +1768
(funcTable.flags[funcIndex] &
(FuncFlag.IsJS | FuncFlag.RelevantForJS)) !==

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not for this PR, but now that we are having more bit flags and tests like this, I wonder if it makes sense to create a generic function for testing these flags to make things easier to read. Especially it's a footgun to forget the parenthesis before !== 0 or == 0 due to them being higher precedence (especially if people are not familiar with it).

But I'm also not sure about the perf overhead of it in hot loops in general. So I think this is perfectly fine.

@mstange

mstange commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've addressed the comments.

@mstange
mstange enabled auto-merge September 18, 2026 15:58
@mstange
mstange merged commit 474974c into firefox-devtools:main Sep 18, 2026
21 checks passed
canova added a commit that referenced this pull request Sep 22, 2026
Changes:

[fatadel] Show a category breakdown in profiler-cli (#6256)
[fatadel] Show allocation data in the cli (#6246)
[Florian Quèze] profiler-cli: name the process in the thread banner, and
follow the queried thread (#6269)
[fatadel] Drive PII sanitization from marker schemas (#6291)
[fatadel] Move FileIO table labels into marker schemas (#6296)
[Florian Quèze] profiler-cli: add a thread list command (#6273)
[Nazım Can Altınova] Update oxfmt 0.63.0 → 0.68.0 (major) (#6316)
[Markus Stange] Add missing finishRawMarkerTableBuilder. (#6318)
[Markus Stange] Fix the upload error button contrast (#6315)
[Markus Stange] Allow typed arrays in the nativeSymbols table (#6300)
[Markus Stange] Remove brittle test. (#6322)
[Markus Stange] Fix file extension typo. (#6325)
[Nazım Can Altınova] Add a permalink command to profiler-cli for already
published profiles (#6331)
[Markus Stange] Typed arrays + flags for the FuncTable (#6323)
[Florian Quèze] profiler-cli: add profile markers for cross-thread
marker search (#6276)
[fatadel] Convert extension text markers to structured payloads (#6314)
[Florian Quèze] profiler-cli: include per-marker fields and data in
--list --json (#6275)
[Nazım Can Altınova]  Add `--with-samply` to "profiler-cli load" (#6339)
[Markus Stange] Speed up call tree sidebar by sharing work with the
activity graph (#6329)
[Nazım Can Altınova] 🔃 Sync: l10n -> main (Sept 22, 2026) (#6341)
[Nazım Can Altınova] Bump profiler-cli version to 0.10.0 (#6342)

And special thanks to our localizers:

el: Jim Spentzos
ro: robbp
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.

2 participants