Strange JS profiler subcategories in this profile
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
People
(Reporter: mstange, Unassigned)
Details
Profile: https://share.firefox.dev/2NiT18d
This profile is from bug 1694048. It's a bit mysterious to me where all the time is spent.
One of the things that I find strange is that there is so much self time assigned to InterpretGeneratorResume. Where is that time spent? In Jit code that was generated for this function? In that case, I would expect the sidebar to show a higher percentage in one of the JIT subcategories, but it's mostly showing "Interpreter".
Is it possible that the "Interpreter" subcategory is incorrectly assigned here? For example, there's this stack:
js::PrimitiveValueToId<js::CanGC>(JSContext*, JS::Handle<JS::Value>, JS::MutableHandle<JS::PropertyKey>)
static js::jit::IonSetPropertyIC::update(JSContext*, JS::Handle<JSScript *>, js::jit::IonSetPropertyIC*, JS::Handle<JSObject *>, JS::Handle<JS::Value>, JS::Handle<JS::Value>)
0x29cdcf85114
InterpretGeneratorResume
If you select the leaf node of this in the tree, it clearly shows that the profiler considers this sample to be in the Interpreter subcategory. From the stack I would expect that it's actually running in Ion.
Comment 1•4 years ago
|
||
I seem to recall us running into this last year, but can't find the bug. In the C++ Interpreter, this code resumes scripts in a way similar to a tail-call, but the related profiler operations are missing. The result is that the resumed code (which may or may not be JIT) is all assigned to this InterpretGeneratorResume.
I'll take a look this week and see if I have patches somewhere and try and understand why it didn't get fixed if we had a root cause..
Comment 2•4 years ago
|
||
This reminds me of bug 1691504. For the stack trace in comment 0, that bug could indeed cause us to attribute JIT time to InterpretGeneratorResume. It's very similar to the confusing stack traces I noticed in bug 1684224.
The profile is from Firefox 85 which does not have the fix for bug 1691504.
| Reporter | ||
Comment 3•4 years ago
|
||
You're right, it indeed seems to be that bug. When I get a profile on reddit with a modern build, I see InterpretGeneratorResume call into lots of jit code without any other profiler stack label in between, and those jit frames would all be missing due to that bug, with no profiler stack label indicating their absence.
I'll file a new bug if I ever notice this problem on a build that includes the fix from bug 1691504.
Description
•