Closed Bug 516969 Opened 15 years ago Closed 3 years ago

Handling onfoo event listener is heavy

Categories

(Core :: DOM: Events, defect, P5)

x86
macOS
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: smaug, Unassigned)

References

(Depends on 7 open bugs)

Details

Attachments

(1 file)

Attached file a profile
Compiling the attribute value and then calling it is heavy.
Nearly 80% of *event dispatch time* in a testcase is spent in nsEventListenerManager::CompileEventHandlerInternal and
nsJSEventListener::HandleEvent
(Includes the time, 11.6%, which is spent to really call the JS function.)

Slow-looking things are for example
nsScriptSecurityManager::CheckFunctionAccess
and often used JS context stack push/pop.
JS_CompileUCFunctionForPrincipals (17%) could be optimized too, I hope.
Olli, do you want to either mail me the .mshark file for that or put it somewhere where I can get at it?  I assume it's too big to attach to this bug?
We cache compiled event handlers, IIRC, so this is first-click (just checking)?

It would be great to see the hierarchical profile data.

/be
Depends on: 517369
Depends on: 517371
Depends on: 517374
Depends on: 517375
Depends on: 517380
Depends on: 517382
Depends on: 517384
Depends on: 517385
Depends on: 517386
Depends on: 517387
We do cache compiled event handlers, but the first case the handler is called/compiled, we spend lots of time compiling/binding it.
Depends on: 517844
Depends on: 517851
Depends on: 517879
Depends on: 519827
Depends on: 519932
Depends on: 536092
How about now?
Need to reprofile compilation.
Situation isn't any better. Compilation seems to be still slow. Bug 517385 has a testcase.
Actually, since event dispatch itself is faster, compilation takes even more % from the total time.
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5

Hi Olli, I assume this is obsolete and/or covered elsewhere?

Flags: needinfo?(bugs)

I guess this is good enough, when comparing to others (better than in Chrome)

Status: NEW → RESOLVED
Closed: 3 years ago
Flags: needinfo?(bugs)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: