I work for 0pera, so would be very interested to know the incompatibilities that prevented your running the tests. if you could email me - brucel AT opera DOT com I'd be very grafeful.
Bruce: I've tried removing the check for Opera there, it didn't change anything. That code is for initializing Excanvas, if it is found. So it should not effect Opera. I believe the problem first occured when this comment was added to mapview.js: /* Load tileset images. FIXME: rendering images loaded this way doesn't work in Opera. */
I haven't looked at the code. But in general, if you drawImage an IMG element, the IMG must be loaded as written in the spec. It's tricky because browsers have different behavior sometimes. So if I remember correctly from my experiment I did a while ago;
var img = new Image; img.src = 'some-img.png'; ctx.drawImage(img, 0, 0);
this only works on the WebKit? browsers. For Opera it's okay as long as the image was cached.
For Firefox, it has to be like this;
var img = new Image; img.src = 'some-img.png'; img.onload = function() {
ctx.drawImage(img, 0, 0);
}
This code works for Opera as long as the image was NOT cached.
For Opera I think I did something like below (I might be wrong);
var img = new Image; img.src = 'some-img.png'; if (img.complete) { // WebKit? and Opera (cached)
ctx.drawImage(img, 0, 0);
} else { // for Firefox and Opera (non-cached)
img.onload = function() {
ctx.drawImage(img, 0, 0);
}
img.src = 'some-image.png'; // Opera fires onload after you set src
This benchmark doesn't seem to be a very good test of canvas performance. I get 236ms in Firefox 3.7a1pre but only about 10% of the total time is spent doing canvas operations like drawImage. This benchmark seems to be predominately measuring javascript performance, which also explains why Internet Explorer's results are so poor.
I got 149.72 in Windows 7 with FF 3.6. Of course that's not relevant since my Sony laptop might not be anywhere near the specs (up or down) used for the initial benchmark.
"Early 2008" iMac, 2.8Ghz Core 2 Duo, 2mb ram, latest Snow Leopard... I also used a relatively large window, resulting in a gameboard around ~1334x773 pixels (measured in chrome) I kept the best score, variance was minimal, with a few spikes of about 20 over these numbers for each browser, probably due to a background process or something.
Oh and something you might want to note in the instructions... The first time I ran this test, for whatever reason, despite following the instructions exactly, the game did not end, and it did not display the whole map. I did not know that was the expected behavior, so I sat there wondering why my numbers were so incredibly low...
You might want to explain the resulting situation for those of us here to throw up benchmark numbers but are totally unfamiliar with "freeciv" and what may be the intent of your instructions.
And you may want to find a way to reliably enforce a specific gameboard size too, in case that plays a notable factor in the performance.
TRASH INTERNET EXPLORER! It's a dead body tied to every web developer knee. Stop developing for it until it disappear as the users will not be able to use any website anymore. Advice users that the site can be used on "real" browsers and point to download links. Until we continue to hack css, javascript and such to make our sites work on IE Microsoft will not be enough worried to develop a real browser, and not this cr*ppy "hog". Stop supporting IE until it will be rewritten, please. Users sees the site going slow anf they think it's web developer's fault, while it's their browser's fault.
Another set of benchmarks on different browsers on the same machine Mac QuadCore? 2.8GHz 2GB RAM
Browser window size does matter so I did this before each run: javascript:window.resizeTo(1024,768) and manually resized Chrome since it has a bug with the .resizeTo method.
RE : Comment by bruce.c.lawson, Jan 28 (and several others)
Bruce - you've just upped Opera appreciably in my estimation - as a company (I don't use the browser, yet). Opera stared off on a reasonably good standing with me, because they made the only usable browser for my Psion-5 (and later, -5mx), and I now feel almost obliged to investigate it further.
Your boss owes you a pint, and you can tell him that from me. (Not that my opinion counts for a flying lemming.)
I think the benchmarks are interesting too - so here's mine.
It's interesting to note that the benchmarks seem to vary wildly, even within the same browser session (you can keep pressing Alt-Q to get more benchmarks), so for each browser I ran the test multiple times and chose an representative one.
Also, I didn't bother with the window resizing stuff - every browser was running with the window maximised.
My benchmarks (rerun 5 times -> average) On Win7 64bit AMD Turion Core II M520, 4GB
- MPC Kromi (Chromium 4.0.256.0 (32773)), 115,61 - QT 4.6.0 Demos (QtWebkit? demo browser 0.1), 286.66 - Arora 0.10.0 (based on QtWebkit? (crashes a lot)), 343.29 - IE8 8.0.7600.16385 (with Google Frame (occasional rejects from game,could-not-connects-to-server)), 52,54
IE8 with 'aggresive' google frame's speed is remarkable, but I will continue to play still this game with browser like MPC Kromi. Somewhat suprised how well QT demo browser performed for example compared to another qtwebkit-based browser arora.
opera 10.5 build 3218 renders the test in 9-10 ms for me. Which build were you using? Perhaps the Opera devs snuck some freeciv friendly code in recently.
It would be interesting to hear what exactly where the deficiencies in Opera 10. In my experience, it has quite fine canvas support.
Which incompatibilities made it impossible to run benchmark in Opera?
+1 for why didn't you test Opera?
I work for 0pera, so would be very interested to know the incompatibilities that prevented your running the tests. if you could email me - brucel AT opera DOT com I'd be very grafeful.
It looks like it's actively checking for Opera:
function initCanvas(canvas) {
}Bruce: I've tried removing the check for Opera there, it didn't change anything. That code is for initializing Excanvas, if it is found. So it should not effect Opera. I believe the problem first occured when this comment was added to mapview.js: /* Load tileset images. FIXME: rendering images loaded this way doesn't work in Opera. */
I haven't looked at the code. But in general, if you drawImage an IMG element, the IMG must be loaded as written in the spec. It's tricky because browsers have different behavior sometimes. So if I remember correctly from my experiment I did a while ago;
var img = new Image; img.src = 'some-img.png'; ctx.drawImage(img, 0, 0);
this only works on the WebKit? browsers. For Opera it's okay as long as the image was cached.
For Firefox, it has to be like this;
var img = new Image; img.src = 'some-img.png'; img.onload = function() {
}This code works for Opera as long as the image was NOT cached.
For Opera I think I did something like below (I might be wrong);
var img = new Image; img.src = 'some-img.png'; if (img.complete) { // WebKit? and Opera (cached)
} else { // for Firefox and Opera (non-cached) }I guess you can simply write it as
var img = new Image; img.onload = function() {
} img.src = 'some-image.png';Oops, I missed some line break.
var img = new Image; img.onload = function() {
}; img.src = 'some-image.png';I see. Line break doesn't become line break.
Just wondering, why was the linux version of firefox so out of date?
Not so much out of date as it is badly optimised. Who knows why (possibly OS share) :(
On Safari 4.0.4 running on Mac OS 10.6.2, 157.92ms
This benchmark doesn't seem to be a very good test of canvas performance. I get 236ms in Firefox 3.7a1pre but only about 10% of the total time is spent doing canvas operations like drawImage. This benchmark seems to be predominately measuring javascript performance, which also explains why Internet Explorer's results are so poor.
Can you post the computer specs for these benchmarks?
I got 149.72 in Windows 7 with FF 3.6. Of course that's not relevant since my Sony laptop might not be anywhere near the specs (up or down) used for the initial benchmark.
Uhm.. on another note I got 43.8 with Chrome...
301.72 on FF3.6, Win7, 2.6GHz Core2Duo?, 4GB RAM
Just tested it several times: # 149.54 # 141.11 # 139.45 # 133.6 # 131.33 # 129.12 # 131.44 # 140.66 # 129.52 Firefox 3.6, Linux SelfMade? (Slackware 12 heavily modified), Core 2 Duo 2Ghz
I ran it again since ppl are saying specs. 147.62, Win 7, FF 3.6, Laptop with a T9900 @ 3.06Ghz, 8GB ram.
But 301 (or 405 for that matter) seems a bit slow.
Uhm... 382.52 in IE8. I think something is really off with their timing routine.
Interesting, would you guys mind running this test with a WebKit? nightly build to see if it's any closer to Chrome? http://nightly.webkit.org/
Guys, also if you run the benchmark run it on all browsers.
The important is not the number itself, but the differences among browsers using the same computer.
329.76 ms on Firefox nightly build.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.3a1pre) Gecko/20100128 Minefield/3.7a1pre (.NET CLR 3.5.30729)
q6600, 4GB, Windows 2003
85.28 Chrome 4.0.249.78 unknown (36714)
272.64 Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7
833.16 IE 8 64-bit Edition
"Early 2008" iMac, 2.8Ghz Core 2 Duo, 2mb ram, latest Snow Leopard... I also used a relatively large window, resulting in a gameboard around ~1334x773 pixels (measured in chrome) I kept the best score, variance was minimal, with a few spikes of about 20 over these numbers for each browser, probably due to a background process or something.
Safari 4.0.4 = 199.84 Chrome 4.0.249 = 204.36 Firefox 3.6 = 404.24 WebKit? r53990 (1/28/10) = 190.2
Oh and something you might want to note in the instructions... The first time I ran this test, for whatever reason, despite following the instructions exactly, the game did not end, and it did not display the whole map. I did not know that was the expected behavior, so I sat there wondering why my numbers were so incredibly low...
You might want to explain the resulting situation for those of us here to throw up benchmark numbers but are totally unfamiliar with "freeciv" and what may be the intent of your instructions.
And you may want to find a way to reliably enforce a specific gameboard size too, in case that plays a notable factor in the performance.
Who gives a shit how fast it's on your whatever computer using whatever browser?
Stop spamming the comments with useless crap.
TRASH INTERNET EXPLORER! It's a dead body tied to every web developer knee. Stop developing for it until it disappear as the users will not be able to use any website anymore. Advice users that the site can be used on "real" browsers and point to download links. Until we continue to hack css, javascript and such to make our sites work on IE Microsoft will not be enough worried to develop a real browser, and not this cr*ppy "hog". Stop supporting IE until it will be rewritten, please. Users sees the site going slow anf they think it's web developer's fault, while it's their browser's fault.
Late 2008 13" MacBook? Core 2 Duo 2.4 GHz 2 GB 1066 DDR3 Safari Version 4.0.4 (6531.21.10)
49.6 ms
Gooooooooooooooo Chrome !!!!
w()()t chr0m3!
Relax, "dospam". I find the commenter-contributed benchmarks interesting.
Another set of benchmarks on different browsers on the same machine Mac QuadCore? 2.8GHz 2GB RAM
Browser window size does matter so I did this before each run: javascript:window.resizeTo(1024,768) and manually resized Chrome since it has a bug with the .resizeTo method.
Safari 4.0.4 - 87.48 Webkit Nightly r53990- 76.4 Chrome 4.0.249.30 - 68.92 Firefox 3.6 - 217.44
RE : Comment by bruce.c.lawson, Jan 28 (and several others)
Bruce - you've just upped Opera appreciably in my estimation - as a company (I don't use the browser, yet). Opera stared off on a reasonably good standing with me, because they made the only usable browser for my Psion-5 (and later, -5mx), and I now feel almost obliged to investigate it further.
Your boss owes you a pint, and you can tell him that from me. (Not that my opinion counts for a flying lemming.)
Firefox 3.5.6 on Intel Quad Core Q9400 (2.66GHz), Gentoo Linux Score:395
Im waiting for the day that opensource applications are over 9000 faster
I think the benchmarks are interesting too - so here's mine.
It's interesting to note that the benchmarks seem to vary wildly, even within the same browser session (you can keep pressing Alt-Q to get more benchmarks), so for each browser I ran the test multiple times and chose an representative one.
Also, I didn't bother with the window resizing stuff - every browser was running with the window maximised.
AMD Phenom II Quad 2.6GHz, Gentoo 64-bit
Firefox 3.6: 467.44 Chromium 4.0.266.0: 152.16 Konqueror 4.3.5: 783.2
Surprised that Konqueror did so badly, but the others performed as expected.
My benchmarks (rerun 5 times -> average) On Win7 64bit AMD Turion Core II M520, 4GB
- MPC Kromi (Chromium 4.0.256.0 (32773)), 115,61 - QT 4.6.0 Demos (QtWebkit? demo browser 0.1), 286.66 - Arora 0.10.0 (based on QtWebkit? (crashes a lot)), 343.29 - IE8 8.0.7600.16385 (with Google Frame (occasional rejects from game,could-not-connects-to-server)), 52,54
IE8 with 'aggresive' google frame's speed is remarkable, but I will continue to play still this game with browser like MPC Kromi. Somewhat suprised how well QT demo browser performed for example compared to another qtwebkit-based browser arora.
Where is Opera?
This is a test-case to reproduce the performance problems in Opera 10: http://www.pvv.ntnu.no/~andrearo/opera-bug.html
Opera 10 takes 1805 ms, Google Chrome takes 5ms. Go figure.
opera 10.50 alpha version is just as fast as chrome on that page, 7-8ms.
opera 10.5 build 3218 renders the test in 9-10 ms for me. Which build were you using? Perhaps the Opera devs snuck some freeciv friendly code in recently.
yep i got 5ms with the last 10.5 snapshot
Nice benchmark! Long overdue. I've built a simple canvas benchmark for smartphones - take a look at http://www.c5bench.com/C5Bench?.