silversurfer5150 — 2012-04-04T15:43:00-04:00 — #1
I am customizing the e-commerce cms Opencart for my site and I have recently tried to do some pretty cool JQuery effects, one in particular Jticker makes it look as though the text is being written by a typewriter.
Could anyone give me tips on optimizing a site for best JS performance.?
The site does load up a few scripts but not excessive amounts and they are all minified. As you are all aware, firefox is usually one of the best browsers and does not usually have performance issues.
My hosting is CRAP too which doesn't help. Could I be looking for a js performance issue that really isn't there but is due to the download speed of my hosting?
paul_wilkins — 2012-04-04T18:22:35-04:00 — #2
About the only way to investigate issues such as this is for us to explore the issue from a web page that exhibits the problem.
silversurfer5150 — 2012-04-05T05:43:39-04:00 — #3
Here you go, its unfinished from an aesthetic point of view but all of the scripts which need to run are running:
Some of the js is written by me but lots of it is written by the author of the original template which I am customising so its not all my fault!
silversurfer5150 — 2012-04-05T06:08:21-04:00 — #4
Firefox 11.0 in particular is exhibiting this slow performance
I also noticed that JQuery tools and Jquery are both included and as one contains the other I do not need both but I cannot seem to download the latest JQuery tools because their site is down. Do you know where I can get the latest version from?
paul_wilkins — 2012-04-05T06:19:56-04:00 — #5
Disable or remove other scripts on the page that are unrelated to the jticker. Does the performance then improve?
silversurfer5150 — 2012-04-05T06:39:56-04:00 — #6
Have just done that and it's not improved. Can you see it too? I have 2 laptops with 2 different firefox 11 and it's occuring on both
silversurfer5150 — 2012-04-05T06:46:48-04:00 — #7
Firefox 3.6 not great with this either and I also have speed/performance issues with another JQuery plugin, Zoomer gallery. All other browsers execute these effects flawlessly. Even IE7 and 8 keep up ok
paul_wilkins — 2012-04-05T06:53:48-04:00 — #8
The purpose of that was to reduce the scripting demands of the page down to only the ticker.
Does this demo page for the jticker have the same slowdown problem for you?
silversurfer5150 — 2012-04-05T06:57:50-04:00 — #9
Not at all its rapid. I am very keen to learn this optimizing/fault finding technique and appreciate your help. I have left the page with only JQuery lib and the ticker for now. Currently when I come across such a problem I can get as far as removing different scripts to see which one is causing the problem but after that I don't have the confidence.
silversurfer5150 — 2012-04-06T06:55:11-04:00 — #10
OK so the solution to this is that all of my parent elements are floated. There are other documented cases online also with regards to issues with JQuery animations and floated elements. Believe me I have explored every other option, disabled every script on the site, deleted every part of the page except the offending elements and it is not until I changed the positioning on those parent elements, (not just the parent but it's parent too) to absolute or relative that the animation speeds up.
Then when I replaced all of the original content and enabled all the other scripts it was working fine.
Very annoying tho as I had worked out a lovely floated positioning for the page and more annoying that all of the other browsers except Firefox are fine. This bug occurs on versions as new as Firefox 11 so anyone else who reads this, just save yourself the headache and develop a workaround using something else other than floats.