Closed Bug 1350612 Opened 7 years ago Closed 7 years ago

dbg.onNewGlobalObject can be too slow even when Debugger in NOT enabled

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME
Performance Impact high

People

(Reporter: ehsan.akhgari, Assigned: jimb)

References

Details

See this profile: https://perfht.ml/2nnVluw

In this profile, it's taking ~5ms every time we load a JSM in the parent process it seems.
Blocks: 1350417
Whiteboard: [qf]
Whiteboard: [qf] → [qf:p1]
Hi Jim,
Do you mind taking a look at this please?
Flags: needinfo?(jimb)
Does this problem occur when we are not using devtools on chrome code? Unless someone has the add-on debugger or the chrome debugger open, onNewGlobalObject should never be called at all.
Flags: needinfo?(jimb) → needinfo?(ehsan)
(In reply to Jim Blandy :jimb from comment #2)
> Does this problem occur when we are not using devtools on chrome code?

Yes.

> Unless someone has the add-on debugger or the chrome debugger open,
> onNewGlobalObject should never be called at all.

That was surprising to me as well...
Flags: needinfo?(ehsan)
Okay, well, that's probably the bug.
(I'm looking into this.)
Component: Developer Tools: Debugger → JavaScript Engine
Product: Firefox → Core
(Assigning in response to comment 5.)
Assignee: nobody → jimb
Status: NEW → ASSIGNED
Summary: dbg.onNewGlobalObject can be too slow → dbg.onNewGlobalObject can be too slow even when Debugger in NOT enabled
:jimb, do you have progress on this?
:jimb, checking in on this again.  Any progress to report here?
I'm sorry. No, I haven't been looking at this at all. I will put it atop my list. I should be able to look at it tomorrow.
I'm not able to see any calls to js::Debugger::fireNewGlobalObject or even Debugger::setOnNewGlobalObject. Ehsan, does it still show up in your profiles?

I'm putting calls to `abort` in those two functions in my daily use browser; we'll see how it goes.
Flags: needinfo?(ehsan)
I haven't seen it, but I also haven't honestly been looking for it...  Although it is kind of odd that I haven't run into it in 4 months!

The abort calls should be quite conclusive at any rate.  If those lead nowhere, please don't burn more time on this, sorry this wasted much of your time, this bug was quite weird, I still don't understand what the profile in comment 0 shows.  :/
Flags: needinfo?(ehsan)
Yes, I've been running a Firefox that crashes promptly if I open the Browser console, so I think we can say that this path is no longer being reached.
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
Performance Impact: --- → P1
Whiteboard: [qf:p1]
You need to log in before you can comment on or make changes to this bug.