ericmckean / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

ANGLE causes significant performance impact #366

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
ANGLE causes some performance tests we use for our WebGL-based game engine to 
run 3-4x slower than not using ANGLE.  To compare I'm using Google Chrome 21 
with default settings, and with --use-gl=desktop to turn ANGLE off and render 
directly with OpenGL.

Try this performance test which puts as many sprites on-screen as possible 
while still getting 30 FPS:
http://www.scirra.com/labs/perftest2-webgl/
It is rendered using WebGL (when supported - check it says "Renderer: webgl", 
because it may fall back to canvas 2D).

Test machine:
Intel Core i5-2500 @ 3.3 GHz (quad core)
8 GB RAM (64-bit Windows 7)
AMD Radeon HD 6570 (December 2011 driver)

Results:
Using ANGLE: 14800 objects
Not using ANGLE: 55000 objects

This seems odd because the renderer is very efficient and will batch up all its 
calls in to just a few drawElements calls, each rendering a thousand or so 
sprites at once.  This should minimise any overhead in the ANGLE engine since 
it makes very few calls overall.  And yet with ANGLE off it gets a result a 
whole 3.7x better.  I understand ANGLE is another layer which may reduce 
performance, but this seems a surprisingly large performance impact especially 
given only a few calls are made.  I think a 1.5x difference would be plausible, 
meaning ANGLE ought to be able to score around 35000 objects.

Can ANGLE be optimised to be faster in this case?  Why is it so much slower?

If there is anything we can do in our engine to work more optimally please let 
us know as well!

Original issue reported on code.google.com by ashlaa...@gmail.com on 5 Sep 2012 at 3:10

GoogleCodeExporter commented 9 years ago
I'm not able to reproduce this. In fact ANGLE is faster than desktop OpenGL on 
my system. I'm getting 13711 objects with ANGLE and 12821 objects with desktop 
OpenGL. The graphics card is an ATI FirePro V5700, with August 2009 drivers.

Do you perhaps have different driver settings for Direct3D and OpenGL? VSync 
and quality settings are the first things that come to mind that could cause 
the difference you're observing. Also please check whether newer or older 
drivers make a difference.

Original comment by nicolas....@gmail.com on 5 Sep 2012 at 5:46

GoogleCodeExporter commented 9 years ago
I'm also unable to reproduce this massive difference.

Test Machine:
Intel Xeon W3530 @2.80 GHz (4 cores, 8 logical)
6 GB RAM (64-bit Windows 7)
AMD Radeon 5770 (12.6 Catalyst driver)

Results: Chrome 21.0.1180.89m
ANGLE: 24700-26400
Desktop GL: ~25000 and it drops if left running.

Original comment by dan...@transgaming.com on 5 Sep 2012 at 6:11

GoogleCodeExporter commented 9 years ago
On my NVIDIA card, I get ~17000 for both desktop gl and ANGLE (with the 
--disable-image-transport-surface command-line argument, which is effectively 
the default with chrome 21 on AMD). So I can't reproduce the issue either. It's 
completely GPU-limited for me.

Original comment by jbauman@chromium.org on 6 Sep 2012 at 5:41

GoogleCodeExporter commented 9 years ago
Apologies, it seems I cannot reproduce the issue in the Chrome browser itself.  
The commandline flags indeed seem to make little/no difference.

However there is another place I can see much improved performance:
'Awesomium', which is a fork of Chromium to build standalone Windows EXEs, and 
using this without ANGLE allows it to run up the much higher score (55k) which 
I can reliably reproduce:
http://www.scirra.com/labs/perftest.zip
Since this code is still based on Chromium, does this suggest better 
performance is possible?  I was curious since it's still Javascript code 
issuing the same WebGL calls, which implies the JS code is not the bottleneck 
and it ought to be possible to get more performance out of either Chrome or 
ANGLE.  I'm curious: what is Awesomium doing to boost performance that Chrome 
isn't?

Original comment by ashlaa...@gmail.com on 6 Sep 2012 at 6:55

GoogleCodeExporter commented 9 years ago
Can you somehow specify the --disable-image-transport-surface command-line flag 
to awesomium? Using chrome's image transport surface may be causing the issue. 
It may be difficult to find out what's causing the issue, as I have no idea 
what version of chrome or ANGLE awesomium is based off of.

Original comment by jbauman@chromium.org on 6 Sep 2012 at 7:07

GoogleCodeExporter commented 9 years ago
Awesomium can take command-line arguments for the Chromium engine, and I did 
try passing --disable-image-transport-surface.  It didn't seem to have any 
effect at all.

Original comment by ashlaa...@gmail.com on 6 Sep 2012 at 8:38

GoogleCodeExporter commented 9 years ago
Are you by any chance using the debug D3D9 runtime (which can be selected from 
the DirectX SDK control panel)? This is useful for development but will affect 
performance.

Original comment by nicolas....@gmail.com on 10 Sep 2012 at 1:28

GoogleCodeExporter commented 9 years ago
Nope, not using debug D3D9 runtime.  I don't even have the DX SDK installed.

Original comment by ashlaa...@gmail.com on 10 Sep 2012 at 4:39

GoogleCodeExporter commented 9 years ago
I'm getting a 3x higher score with FireFox vs. Chrome for 
http://www.scirra.com/labs/perftest2-webgl/, even when I make them use the same 
version of ANGLE.

Original comment by c...@chromium.org on 21 May 2014 at 6:22