Bug 802677

Summary: Eats CPU on idle with statically looking page
Product: [Fedora] Fedora Reporter: Milan Crha <mcrha>
Component: firefoxAssignee: Gecko Maintainer <gecko-bugs-nobody>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: gecko-bugs-nobody, jhorak
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-03-27 13:50:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Milan Crha 2012-03-13 09:27:08 UTC
When I open this URL in firefox
   http://www.sdltutorials.com/
then after it's loaded, and I do not do anything with that page, just looking at it, then firefox eats up to 20% of my CPU. If I change tab, like back to this bug report filling, then firefox calms down and is back idle. Selecting the SDL tab makes firefox back to eating CPU state, even when the firefox itself is not focused window.

I'm wondering what is wrong with that site that it eats my CPU.

This is with firefox-10.0.1-1.fc16.x86_64.

Comment 1 Jan Horak 2012-03-27 13:50:24 UTC
There's a 'game' loop in javascript on this page (game.php):
Main.OnLoop = function() {
  while(Events.HasEvents()) {
    var Event = Events.GetEvent();
    console.log("Event : " + Event.Type + " - " + Event.Key);
    Game.OnEvent(Event);
  }
  Main.Context.clearRect(0, 0, Main.Width, Main.Height);
  Game.OnLoop();
  Game.OnRender(Main.Context);
  FPS.OnLoop();
  setTimeout(Main.OnLoop, 2);
}
So this is most likely wanted to make your CPU busy :).

Comment 2 Milan Crha 2012-03-28 14:13:51 UTC
Thanks for looking at it. I'm wondering why they are doing that, but that has definitely nothing to do with firefox.