Firefox3 slowness with setStyle
Reported by Cahaan | June 18th, 2008 @ 05:34 PM
I have observed a performance issue with FireFox3 and Prototype 1.6.0.2
I use the setStyle function in order to move some div on the screen while the mouse is moved (drag&drop style). It was quite fast with FireFox 2.xxxxx but now with FireFox 3 it became suddenly sluggish for some reason.
The performance is fine for other browsers I've tested (IE7, Opera 9.5).
I'm not sure that this is related to the setStyle function in Prototype but I just wanted to mention it (in case where it could be improved).
Cahaan.
Comments and changes to this ticket
-
Juriy Zaytsev June 18th, 2008 @ 06:18 PM
- → Milestone cleared.
I'm guessing that setStyle is working with top/left properties?
I'll take a look at what the problem is.
Thanks.
-
Cahaan June 19th, 2008 @ 01:36 PM
Thank you very much Juriy.
Yes I move divs using setStyle and top/left properties.
Here's a sample of the code that I'm using:
$('anId').setStyle( { position: 'absolute', left: ax, top: ay } ); -
Juriy Zaytsev June 19th, 2008 @ 01:59 PM
- → Milestone cleared.
I don't see anything suspicious in the code. setStyle({ top: ..., left: ... }) boils down (after a couple of extra calls) to:
element.style.top = ... element.style.left = ...Does assigning those manually gets rid of a sluggishness?
-
John-David Dalton June 19th, 2008 @ 03:57 PM
Sam noticed that Firefox 3 for Mac is sluggish when scrolling maybe they are related...
-
Juriy Zaytsev June 19th, 2008 @ 04:01 PM
Firefox 3 is a disaster. It freezes/gets sluggish all the time.
-
Tobie Langel June 19th, 2008 @ 06:04 PM
- no changes were found...
-
Cahaan June 19th, 2008 @ 11:46 PM
I tried to modify the divs style the way you suggested Juriy, unfortunately, it's exactly as slow as before.
I guess this is only related to the new Javascript engine in FireFox3 and that it has nothing to do with Prototype...
Maybe the slowness issues should be submitted to Mozilla.
Thanks for the feedback, very appreciated! :)
-
Juriy Zaytsev June 19th, 2008 @ 11:58 PM
- → Milestone cleared.
Maybe the bottleneck is something else. Are there any other methods executed besides setStyle?
-
Cahaan June 20th, 2008 @ 12:13 AM
The only other methods that are called are e.pointerX() and e.pointerY() to get mouse coordinates.
Please check the following PWC sample:
http://prototype-window.xilinus....
And then click on the link under the first "Add on" title.
Move the window around with FireFox 3. You will be able to observe that the inner HTML of the window is sluggish (if you make the window bigger, it's even more noticeable).
This doesn't occur with FireFox 2.xxx, Opera 9.5 or even IE 7; only getting that crappy behaviour with FireFox3.
-
Juriy Zaytsev June 20th, 2008 @ 12:17 AM
PWC is now officially replaced with Prototype UI where few significant speed improvements were made. http://www.prototype-ui.com/ Is it possible for you to update?
-
Cahaan June 20th, 2008 @ 12:19 AM
Juriy, thanks a lot for the suggestion, however this is not related to my issues. I'm not even using PWC, just modifying the style of my own divs! I just pasted that PWC link because it illustrates how much FireFox3 is slower than it's predecessors when executing Javascript code.
-
Juriy Zaytsev June 20th, 2008 @ 12:50 AM
I agree - something is not right.
We would need actual tests to attach to a ticket (when submitting to Mozilla's tracker)
-
Cahaan June 20th, 2008 @ 11:30 AM
It would be hard for me to isolate some kind of test in my current application, because my wep app is not online yet, and requires login and stuff.
Maybe it would be more practical to use already existing benchmarks?
Cheers,
Cahaan.
-
Cahaan June 20th, 2008 @ 12:06 PM
Oddly enough, I tried the SunSpider benchmark and it gives good results with FireFox3.
Maybe the slowness would be related to something else, such as the display of images...
-
John-David Dalton June 24th, 2008 @ 07:57 PM
- → State changed from new to not_for_core
Ok since this appears not to be a Prototype bug I am marking this as "not for core".
-
Tobie Langel June 25th, 2008 @ 12:00 AM
- → State changed from not_for_core to invalid
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
The Prototype JavaScript library.
