Author Topic: Javascript scrolling gig list causes high CPU on Firefox 3.6  (Read 10212 times)

Mark Davies

  • Sr. Member
  • ****
  • Posts: 883
  • Karma: +6/-1
    • Man & Deke Leonard Photo Album
I have just noticed that the Javascript scrolling gig list causes high CPU on my system on the latest Firefox 3.6.3 (on Windows XP SP3).

With only Firefox running, and with one tab open at the Manband Forum, Firefox uses about 25% CPU on my dual processor system (i.e. about half a processor). If I open up a second tab with the Manband Forum, it maxes out at 50% CPU (i.e. 100% of a processor).

I can reproduce this behaviour on another system. Also, IE & Chrome do not exhibit the problem.

If I disable Javascript, then the CPU problem goes away. In fact, if I hover over the scrolling gig list with my mouse cursor, then the gig list stops scrolling and the Firefox CPU usage drops to zero (ish).

Looking at the Javascript, it uses "Cross browser Marquee II" for the scrolling gig list. Googling shows that this is a known problem (which has actually been around for at least a year), with a suggested fix to initializemarquee():

http://www.dynamicdrive.com/forums/archive/index.php/t-41987.html

Jules

  • Administrator
  • Hero Member
  • *****
  • Posts: 2055
  • Karma: +40/-8
    • The Manband Archive
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #1 on: May 06, 2010, 11:40:17 PM »
I've applied that patch, with some tweaks to make it work inside the <div> boundaries rather than scroll the entire page (ouch!). CPU usage is still pretty high on IE when scrolling (drops when paused). CPU seems better on Firefox, Safari, Chrome and Opera.

Let me know how it's working for you know?
« Last Edit: May 06, 2010, 11:42:47 PM by Jules »
Boldly going.......

Mike Morgan

  • Guest
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #2 on: May 07, 2010, 02:14:46 AM »
I was with you as far as 'good morning'.  Hope whatever needs to to get sorted does.

Staying up for the election results and losing the plot by the minute!

Mark Davies

  • Sr. Member
  • ****
  • Posts: 883
  • Karma: +6/-1
    • Man & Deke Leonard Photo Album
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #3 on: May 07, 2010, 10:00:45 AM »
I've applied that patch, with some tweaks to make it work inside the <div> boundaries rather than scroll the entire page (ouch!). CPU usage is still pretty high on IE when scrolling (drops when paused). CPU seems better on Firefox, Safari, Chrome and Opera.

Let me know how it's working for you know?

Sorry, but to me, it appears no better, and possibly worse.

Jules

  • Administrator
  • Hero Member
  • *****
  • Posts: 2055
  • Karma: +40/-8
    • The Manband Archive
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #4 on: May 07, 2010, 01:12:45 PM »
Interesting. I certainly saw a small improvement, maybe a 15% drop or thereabouts (not on IE though).

I shall mull.......
Boldly going.......

Rob W

  • Hero Member
  • *****
  • Posts: 4094
  • Karma: +1089/-1080
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #5 on: May 07, 2010, 05:13:29 PM »
I was with you as far as 'good morning'.  Hope whatever needs to to get sorted does.



Well I thought them two were talking a right load of b*ll*cks. But then I noticed, neither said "good morning", so what are you goin' on about?

:)

Mike Morgan

  • Guest
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #6 on: May 07, 2010, 06:56:45 PM »
Quote from Red Dwarf.  Lister listened to a lenghty explanation about something techy from Kryten and at the end said  I was with you...

Another one:

Cat: I'm so hungry. I just have to eat!
Lister: Shh... Rimmer's dad's died.
Cat: I'd prefer chicken.

Jules

  • Administrator
  • Hero Member
  • *****
  • Posts: 2055
  • Karma: +40/-8
    • The Manband Archive
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #7 on: May 08, 2010, 08:14:21 PM »
I've now swapped out the marquee2 script for another with similar functionality. This looks a little clunkier in IE, but is less cpu hungry.

Checked on IE8, Firefox 3.6.3, Opera 9.8, Safari 4.5.5  and Chrome 4.1.249.1064.
Boldly going.......

Rob W

  • Hero Member
  • *****
  • Posts: 4094
  • Karma: +1089/-1080
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #8 on: May 08, 2010, 08:58:24 PM »
I've now swapped out the marquee2 script for another with similar functionality. This looks a little clunkier in IE, but is less cpu hungry.

Checked on IE8, Firefox 3.6.3, Opera 9.8, Safari 4.5.5  and Chrome 4.1.249.1064.

Thank f*ck for that


:)  :)

Mike Morgan

  • Guest
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #9 on: May 09, 2010, 12:20:03 AM »
I've now swapped out the marquee2 script for another with similar functionality. This looks a little clunkier in IE, but is less cpu hungry.

Checked on IE8, Firefox 3.6.3, Opera 9.8, Safari 4.5.5  and Chrome 4.1.249.1064.

I was just about to post that as an option you might have wished to consider ;)

Nick Nation

  • Crintabulator
  • Hero Member
  • *****
  • Posts: 2736
  • Karma: +119/-4
  • Micky Jones 1946 - 2010 Clive John 1945 - 2011
    • Nick Nation
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #10 on: May 09, 2010, 11:36:50 AM »
I've now swapped out the marquee2 script for another with similar functionality. This looks a little clunkier in IE, but is less cpu hungry.

Yeah, but now my video doesn't rewind.
Nationsounds - the label that brought you Shake The Nation and raised 1,500 in memory of Micky...

Jules

  • Administrator
  • Hero Member
  • *****
  • Posts: 2055
  • Karma: +40/-8
    • The Manband Archive
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #11 on: May 09, 2010, 01:12:44 PM »
Yeah, but now my video doesn't rewind.
Turn your screen round and run it backwards.
Boldly going.......

Nick Nation

  • Crintabulator
  • Hero Member
  • *****
  • Posts: 2736
  • Karma: +119/-4
  • Micky Jones 1946 - 2010 Clive John 1945 - 2011
    • Nick Nation
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #12 on: May 09, 2010, 01:17:32 PM »
...but at least I've got the hang of using the 'quote' box....
Nationsounds - the label that brought you Shake The Nation and raised 1,500 in memory of Micky...

Jules

  • Administrator
  • Hero Member
  • *****
  • Posts: 2055
  • Karma: +40/-8
    • The Manband Archive
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #13 on: May 09, 2010, 01:22:04 PM »
 ;D
Boldly going.......

Mark Davies

  • Sr. Member
  • ****
  • Posts: 883
  • Karma: +6/-1
    • Man & Deke Leonard Photo Album
Re: Javascript scrolling gig list causes high CPU on Firefox 3.6
« Reply #14 on: May 09, 2010, 01:36:23 PM »
I've now swapped out the marquee2 script for another with similar functionality. This looks a little clunkier in IE, but is less cpu hungry.

Checked on IE8, Firefox 3.6.3, Opera 9.8, Safari 4.5.5  and Chrome 4.1.249.1064.

Looks good to me. Thanks. Glad to see the ManBoard is maintaining its eco-friendly, green credentials  ;)