Closed Bug 415423 Opened 17 years ago Closed 17 years ago

CPU at 100% with canvas in Firefox 3b

Categories

(Core :: Graphics: Canvas2D, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: alberto.email, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9b2) Gecko/2007121120 Firefox/3.0b2 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9b2) Gecko/2007121120 Firefox/3.0b2 With Firefox 2 the page works fine, but with Firefox 3b, if I leave the animation without the aperture, after a while Firefox reaches 100% of cpu usage... It does not happen with Firefox 2 Reproducible: Always Steps to Reproduce: 1. Load the page http://alberto.orlandini.googlepages.com/barberspole.html 2. Remove the aperture (Click on Show) 3. Wait a while and open Task Manager / System Monitor Expected Results: Firefox 3b reaches 100% of cpu usage Firefox 2 works great, and cpu usage stays lower than 2%
There's a missing ctx.beginPath(); in moveclip() under if(!FLAGhide || true). So if there's !FLAGhide, there's no beginPath() call at all which seems to be what's causing the CPU usage to spike. I'm not familiar with the details of canvas of how canvas works under the hood and why it works on FF2 but not FF3, but sticking a ctx.beginPath(); in the indicated location fixes it.
On Windows XP using a branch build it is 61% and on trunk indeed 100% CPU.
Thanks for the answers! Ok I've corrected the code: http://alberto.orlandini.googlepages.com/barberspole2.html Now it works fine on Windows XP, total cpu usage is lower than 2%. Yet, I tried it on ubuntu feisty with FF 2.0.0.3, firefox cpu usage is around 2% but Xorg is very high, over 60%... I hope new versions of FF for linux have solved this problem...
Blocks: 296904
Status: UNCONFIRMED → NEW
Component: General → Layout: Canvas
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → layout.canvas
Version: unspecified → Trunk
Yep, was caused by bug 296904, though that patch is still correct. Sounds like there was a fix in the original page. As for the Xorg CPU usage, nothing we can do -- we're simply making requests to draw through Cairo, which is in turn making requests to RENDER/X. You may want to try a different/newer video driver, or experiment with EXA or some of the other options.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.