google0702.10.swsnyder | 2 Jul 2007 22:02
Favicon

Event listener search slowed by Roboform

About every 6 months or so I get a bug up my butt about the dismal
effect that Roboform has on SeaMonkey performance.  Well, it's that
time again and this time I have hard numbers to back up my claims that
Roboform dramatically slows the page load times.

For those who haven't heard of it, Roboform is a commercial product
(http://www.roboform.com) that fills edit fields in the major web
browsers.  Its primary value is that usernames/passwords can be held
in common for both IE and Mozilla browsers.  It works by examining the
URL of each page when loaded and comparing it to the URLs saved by the
user on which there are edit fields to fill.

My experience is that use of Roboform increases page load times by 35%
- 40%.  It is not that Roboform itself executes slowly.  It takes some
CPU time, of course, but doesn't appear very high in profiler
reports.  Rather it is the effect that the presence of Roboform (any
plug-in?) has on Mozilla code.

I have long seen when profiling SeaMonkey that the time spent in
nsEventListenerManager::HandleEvent() spikes when Roboform is used.
This routine determines whether or not there are any listeners for a
given event type.

I am using the latest released versions of SeaMonkey (v1.1.2, with no
other plug-ins) and Roboform (v6.9.3).  My test is to simply load the
10 most popular US web sites as determined by Alexa (http://
www.alexa.com/site/ds/top_sites?cc=US&ts_mode=country&lang=none) and
count the searches for pending events.

I have a single identity (URL + username/password) defined in Roboform
(Continue reading)

Boris Zbarsky | 2 Jul 2007 22:16
Picon
Favicon

Re: Event listener search slowed by Roboform

google0702.10.swsnyder <at> spamgourmet.com wrote:
> What the ^%&*^%$! is going on here

Roboform attaches mutation event listeners.  We then start firing said events. 
We don't fire them if there are no listeners. The reason for that is that firing 
them is very expensive, at least when you do it on every single node append or 
attribute set during parsing.

> and what can be done to fix it?

Not much.  Trunk doesn't fire mutation events during parsing; we might end up 
changing branch to do the same.  That might help.  Of course it might also break 
Roboform if it listens for those events.  And any DOM changes done from script 
would still be a lot slower while Roboform is around.

I would be curious to see what your measurements show for a trunk Seamonkey or 
Firefox build.

-Boris
google0702.10.swsnyder | 2 Jul 2007 23:45
Favicon

Re: Event listener search slowed by Roboform

On Jul 2, 4:16 pm, Boris Zbarsky <bzbar... <at> mit.edu> wrote:
> Not much.  Trunk doesn't fire mutation events during parsing; we might end up
> changing branch to do the same.  That might help.  Of course it might also break
> Roboform if it listens for those events.  And any DOM changes done from script
> would still be a lot slower while Roboform is around.

I'm not clear (== totally ignorant) as to what mutation events are
used for.  I would think that an application likeRoboform would want
to hook Load events.

Can you point me to some doc on mutation events?

Thanks.
Boris Zbarsky | 3 Jul 2007 01:41
Picon
Favicon

Re: Event listener search slowed by Roboform

google0702.10.swsnyder <at> spamgourmet.com wrote:
> I'm not clear (== totally ignorant) as to what mutation events are
> used for.

Seeing when changes in the DOM happen.  E.g. when someone adds nodes to the 
tree, removes them, changes attribute values, etc.

> Can you point me to some doc on mutation events?

See <http://www.google.com/search?q=mutation+events> the first hit.

-Boris

Gmane