Profiler misreports Ion frames as Baseline frames
Categories
(Core :: JavaScript Engine: JIT, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox109 | --- | fixed |
People
(Reporter: mayankleoboy1, Assigned: jandem)
References
(Blocks 3 open bugs)
Details
Attachments
(1 file)
Go to https://codepen.io/Mamboleoo/pen/NWYQMwR
Profile: https://share.firefox.dev/3UHtv9G
I was looking at the "copy" function that profiler suggests spends 85% time in Baseline
Assignee | ||
Comment 1•3 years ago
|
||
Looking at this locally in the profiler, that copy
function does seem to be a bit weird even though it's a tiny and trivial function.
I'll take a closer look later this week to see if it's there's anything weird going on.
Assignee | ||
Comment 2•3 years ago
|
||
I looked at this more. What's happening is that the profiler gets confused when the sampler pc is in Ion IC code. At the end of JSJitProfilingFrameIterator::JSJitProfilingFrameIterator
we then assume it's Baseline code.
We should probably add an IonEntry
to the profiler's jitcode table for Ion IC code.
I can reproduce with something like this:
function g(o) {
o.x = 1;
o.y = 2;
}
function f() {
with (this) {};
for (var i = 0; i < 100_000_000; i++) {
var o = {};
var p = {a: 1};
g(o);
g(p);
}
}
f();
Assignee | ||
Comment 3•3 years ago
•
|
||
I also noticed something unexpected with the profiler UI: if I go to the stack chart, invert the stack, and hover over a JS function stack frame, sometimes the popup displays "Category: JavaScript" instead of the sub category (for example "Category: JavaScript: JIT (Baseline)").
I don't understand yet what's causing that.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 4•3 years ago
|
||
Let's keep this in the JS component because the issue in comment 2 will require a JS engine fix.
Updated•3 years ago
|
Reporter | ||
Comment 6•3 years ago
|
||
Profile after bug 1801875: https://share.firefox.dev/3VosuUh
I am guessing there is more work required here.
Assignee | ||
Comment 7•3 years ago
|
||
(In reply to Mayank Bansal from comment #6)
Profile after bug 1801875: https://share.firefox.dev/3VosuUh
I am guessing there is more work required here.
Yeah that bug is just a refactoring, it shouldn't have any observable differences.
Reporter | ||
Updated•3 years ago
|
Assignee | ||
Comment 8•3 years ago
|
||
This fixes an issue where the profiler reported samples in Ion IC code as Baseline code.
This patch is based on bug 1614622 part 1, where we removed similar code for the old
Ion IC system, but a bit simplified after changes in bug 1801875 and other bugs.
There might be similar issues with trampoline code. Eventually it would be nice to
report time in Baseline IC code, Ion IC code, and Trampoline code separately in the
profiler, but that needs some refactoring of how frames are reported.
Updated•3 years ago
|
Reporter | ||
Comment 10•3 years ago
|
||
Could there be cases where the profiler misreports that we are spending time in Ion, but we are not?
Assignee | ||
Comment 11•3 years ago
|
||
(In reply to Mayank Bansal from comment #10)
Could there be cases where the profiler misreports that we are spending time in Ion, but we are not?
Not that I'm aware of, but the profiler has some code that's hard to reason about.
Comment 12•3 years ago
|
||
bugherder |
Reporter | ||
Comment 13•3 years ago
|
||
Profile with latest Nightly: https://share.firefox.dev/3OJNN0o
Reporter | ||
Updated•3 years ago
|
Description
•