My numbers are roughly the same as yours: 41.841 vs 445.104. Debian Linux, Intel i5, Sandy Bridge graphics, Firefox 16 and Chrome 22.
Discussion
Julian Klotz • 10 years ago see moreMethod: fillRect
Firefox 18b: ~70.000FPS
Chrome Canary: ~139.000FPS, Version 26.0.1366.0
MacOS 10.6.8, c2d 2GHz, 4GB RAM, GeForce 9400mIt feels to me that performance improved again with version 18.
Ben Combee • 10 years ago see moreMac OS X on a 2.66Ghz C2D MacBook Pro: Firefox 16.0.1 gives 84.8K FPS with FillRect, Chrome 22.0 gives 89K.
Rex Morgan • 10 years ago see moreI'm getting ~70k in chrome and 200k in Firefox 15.0.1, I upgraded to Firefox 16.0.1 and it dropped to about 180k.
simeon • 10 years ago see moreOSX (Mountain Lion) here: FF 16 112000, Chrome 113000. No real difference for me.
Paul Stadnikov • 10 years ago see moreDebian linux 7.0 Nvidia GeForce 9600 GT/PCIe/SSE2 Intel® Core™2 Duo CPU E8400 @ 3.00GHz × 2
Firefox 30840 (20 tabs) / Chromium 335968 (3 tabs) / Chrome 355380 (1 tab) 345508 (10 tabs)PatrickBrowne • 10 years ago see moreI had the same behavior : 30 000 FPS on firefox, 400 000 in Chrome
ubuntu 11.10 intel i7 with nvidia graphic card
might be not just you :)Corey Richardson • 10 years ago see moreI'll run this later on my workstation (running Linux) at home, but my laptop running Windows 7 (http://www.amazon.com/Compa... gets 102900 FPS on Firefox 16, 190476 on the latest Chromium (still windows). Additionally, the Chromium version is running very noticeably faster.
Tyir • 7 years ago see moreI think my FF has a problem...
Ubuntu, geforce, i5
fill rect -- Chrome : 488 000 FF : 16 000
Draw image -- Chrome : 37 000 FF : 7 500
Get image -- Chrome : 1600 FF : 600Joe Shelby • 7 years ago see moreupdating to current, things are still sluggish, if not as drastically. For fillRect:
Chrome 43 OSX - 333000 or so
Firefox 34 OSX - 240000 or soso it is a third slower for me (mid 2010 iMac, Yosemite).
Adrian Hoffsten • 7 years ago see moreSeems to have gotten better since then or chrome have gotten worse :) 300k on chorme and about 430k on firefox
W. • 10 years ago see moreOS X on Macbook Pro (late 2011 - i7 2,2GHz, 8 GB of 1333 MHz DDR3):
Chrome 22: 150K,
Safari 6.0.1: 340K,
Opera 12.50: 307K,
Firefox 16: 140KCorey Richardson • 10 years ago see moreAlright, on my workstation with a Xeon E3-1230 V2 running Archlinux, kernel 3.6.1 with Radeon drivers and an Radeon HD 6850, Firefox 16 and Chromium 22, I get 181471FPS with fillRect, 24979 with drawImage with FF. 465808FPS with fillRect, 43328 with drawImage in Chromium. As others mentioned, fix your benchmark and maybe this will get someplace.
- −
- href="#" data-action="collapse" title="Expand" name="Collapse">+
Marek Gibney Mod Corey Richardson • 10 years ago see moreFix it in which way?
keef • 10 years ago see moreOSX 2.8Ghz intel core 2 Duo NVIDIA GeForce 9600M GT Firefox 72,000 Chrome 54,000 (Safari 170,000)
Groxx • 10 years ago see moreOSX 10.8.1:
FF 17.0a2 (2012-10-08): 118k fillRect and 25k drawImage
Chrome 22.0.1229.94: 118k fillRect and 95k drawImage
Chrome 24.0.1306.0 canary: 220k fillRect and 110k drawImageFF 18a2 is currently not launching for me :| if it works I'll leave another comment. But if it isn't just you, it seems like a fix may be in the works.
Johan • 10 years ago see moreWindows 7, i7 960, HD 5870:
FF 16.0.1 : 229446
Chrome 22.0.1 : 153994ndesaulniers • 10 years ago see moreMac OSX, 1.7GHz Core i5 (dual core, hyperthreaded), Firefox 16.01 109235
Eaglehooves • 10 years ago • edited see morei5-2520M NVS4200M Win7Pro
230000 in FF16.0.1, 125000 in Chromium 23.0.1258.0ew • 10 years ago • edited see moreDoing fillRect test:
Chromium
Version 20.0.1132.47 Ubuntu 12.04 (144678)
~448000Firefox
Firefox: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0
~9300Avinash Shetty • 10 years ago see morefillRect = 219780 on FF 16.0.1 , 103481 on chrome 22.0.1229.94
drawImage = 107422 on FF , 94162 on chromeSo, it is just you.
Emmanuel Florac • 10 years ago see more5 yo PC, slackware 14 with Radeon HD6450: Firefox 16 95000 FPS. Chrome 260000 FPS. The fact that my old cranky PC beats yours is surprising. Graphic driver problem?
< href="https://disqus.com/by/katelyngadd/" data-action="profile" data-tab="" data-username="katelyngadd" target="_blank" rel="noopener noreferrer">Katelyn Gadd • 10 years ago see moreFine here. You should check about:support to see if you're getting GPU acceleration and make sure you have modern drivers.
Not sure Canvas is hardware accelerated on OSX for Firefox yet.Marek Gibney Mod Katelyn Gadd • 10 years ago see moreMy question is mainly about non-accelerated machines, because thats what I use most for the heavy rendering. Interestingly, I see "GPU Accelerated Windows: 0" on my main machine too. Even though webgl works on this machine in Firefox. It has a Geforce 630GT and is running Mint. To get the card running properly, I did this: http://www.gibney.org/mint_...
Katelyn Gadd Marek Gibney • 10 years ago see moreMeasuring browser performance at using fillRect to draw single pixels isn't particularly meaningful; doing it for software rendering is even less meaningful. To draw pixels you should be using ImageData.
If you want to measure performance for large rect fills you should measure that. 1x1 rect fills will basically measure the speed at which you can call from JS all the way down into the graphics stack and back out, which won't really map meaningfully to performance for actual uses of canvas.It's also worth noting that since your code constructs fillStyle strings for every fillRect, you're also accidentally measuring a bunch of other stuff:
Garbage collector performance
String concatenation performance
CSS color string parsing performance
You may also be measuring the performance of Math.random() since you call it twice per draw.P.S. You may get more accurate timing results from Date.now() or window.performance.now() (see http://www.w3.org/TR/hr-time/ )
Drew Coleman • 10 years ago see moreFirefox struggled a bit at first but it chugged along at 200k+, just like chrome did. Win 7, Phenom II X4 4GHz, 12GB RAM, Radeon 6870, SSD
Jarrod Overson • 10 years ago see moreIt could be the implementation of fillRect. I've noticed some flip flopping in performance on chrome based off different implementations of drawing single pixels.
Here is a relevant jsperf.
http://jsperf.com/setting-c...Check the earlier revisions to find out the history of the test.
Bojan Bjelić • 10 years ago see moreCould be just you.
Chrome 22 (14 tabs) cca 90.000 FPS
Firefox 16.0.1 (2 tabs) cca 150.000 FPS
The discussion is closed now