Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Cross Browser marquee II - causes unusually high CPU usage in firefox

  1. #1
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cross Browser marquee II - causes unusually high CPU usage in firefox

    1) Script Title:
    Cross Browser marquee II

    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex2/cmarquee2.htm

    3) Describe problem:

    When I view the marquee in IE it works just fine but when I view it in firefox it degrades the performance of my PC.

    Using TaskManager > Processes I can see that firefox.exe is now taking approx on average 30-35% of the CPU time.

    When I move the mouse over the marquee to pause the marquee scrolling, after a second or two the CPU %age for firefox drops to 0. Then if I mouse away and scrolling starts again, the CPU usage rises again to the previous level.

    I am using Firefox 3.0.6 on XP Home SP3.
    1.35GHz AMD Athlon CPU and 448MB RAM.

    (NB I first discovered this problem as our website was coded by a webdesigner a few years ago using a version of this marquee, and when we moved to firefox last month I noticed CPU usage went to nearly 90% when the marquee scrolled, and everything else was totally killed. See www.altmore.co.uk. I got a shock when I found your site and firefox was struggling here too, though not as much as with our site - maybe the amount of text were putting through it might be a factor ?

    PS this could explain the problems ppl have with firefox viewing flash on the same page as the marquee, as flash is also processor hungry)

    By the way, thanks for providing all this stuff!

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    It doesn't do it for me, it stays at 00 all the time.

  3. #3
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    in firefox ?

    what version are you running?
    also, what is the spec of your PC?
    That might have something to do with it...

    And were you running other programs, or just your browser?

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Fx 3.0.6 XP SP3 Intel 2.8 GHz 2 Gb RAM

    I was just running some basic programs, photoshop, word, etc.

  5. #5
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    on my work PC (which is slightly higher spec than my home PC) I can reproduce this also, but at average of approx 25% of CPU usage - which is still way above what it should be.... (drops to 0-2% when scrolling paused)

    spec =
    firefox 3.0.6, XP Pro SP3
    2.53GHz Celeron CPU, 1.99GB of RAM

    i.e. very similar spec to Snookerman, but an AMD processor, not Intel !
    Also, my home PC has an AMD processor

    Hmm, is there a pattern here ?
    I've heard that AMD's don't have a maths co-processor so not so good for graphics, gaming etc. (which I'm not into, so not bothered), but maybe the way Firefox is rendering this scroller makes heavy use of graphics/maths routines, and AMD's can't keep up ?

    Anyone else with an AMD chip, or lower spec machine able to reproduce this ?

    And, Is there some other way to implement this component so it doesn't make so many graphics/maths calls in firefox ?

    many thanks!

  6. #6
    Join Date
    May 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Same thing is happening for me! Glad you posted this, because I really wondered what was going on!

    What is the work around? I have to solve this fast, maybe rewrite as a Flash component instead of using the marquee II

    Thanks

  7. #7
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I came back to this as its very annoying and still not sorted !!

    It might be a bug in FF, see:
    https://bugzilla.mozilla.org/show_bug.cgi?id=442797

    While they get round to (maybe) fixing it, can anyone suggest a work-around?
    don't know enought about javascript (yet) myself to fix it :-(

  8. #8
    Join Date
    Feb 2009
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I added it as a FF bug (to bugzilla)

    Bug 500410

    https://bugzilla.mozilla.org/show_bug.cgi?id=500410

    Anyone who can reproduce it, or shed any light on it, might want to post on bugzilla (not sure what the protocol is, so please check first) as well as here!

  9. #9
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    A work-around was posted in the bug as
    https://bugzilla.mozilla.org/attachment.cgi?id=385508 with the javascript moved with the content into an iframe ( https://bugzilla.mozilla.org/attachment.cgi?id=385507 ) that simply scrolls itself, no CSS reflow happens then, which is referred to in comments as https://bugzilla.mozilla.org/show_bug.cgi?id=502288 and https://bugzilla.mozilla.org/show_bug.cgi?id=479655 - the fixes to which will likely only appear in the next *major* update of Firefox sometime within the next couple of years, so go with the work-around.

  10. #10
    Join Date
    Jul 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Clearly the code could use a tweak to break out of the iFrame whenever a link is clicked on. Here's the adjusted initializemarquee function:
    Code:
    function initializemarquee(){
    	var ah = document.getElementsByTagName("a");
    	for (var b=0;b<ah.length;b++) {
    		ah[b].setAttribute("onclick","top.location = this.href")
    	}
    	cross_marquee=document.getElementById("vmarquee");
    	cross_marquee.style.top=0;
    	setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
    }

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •