[sldev] openGL Profiling

Laurent Laborde kerdezixe at gmail.com
Tue Apr 3 04:30:43 PDT 2007


hi.

I ran some openGL profiling here. Sitting in front of rob's office,
doing nothing, with a mac book pro 2Ghz, ATI X1600, run multiple
thread, use VBO, windowed mode, latest offcial release.

The profiler itself use a lot of cpu, so i'm not sure how accurate is
the information.
Unfortunally i had to disable the backtraces collections to save some cpu time.
while i was fetching openGL stats, the framerate slowly but
significantly dropped over time (from 12 to 5fps) because of the
openGL profiler having to process more and more data.

a csv file of the result is attached to this mail.
The result show nothing you didn't knew already (hopefully) :
- the total estimated % application time in GL is 12%
- the big winner is glDrawRangeElements with 52% of GL time and 6% app
time (estimated).
- followed by glDrawRangeElements wich is significantly faster and
called les often than glDrawRangeElements.
- the slowest gl function is glTexImage with 1205us per call. (avg). A
slowest GL call is glDeleteBuffers (3903us) but it was called only 12
times.
- i was surprised to find some glReadPixels, which is, of course, a slow call.

i checked some trace in a different session. But with around 40.000
line per seconds it's a bit hard to follow :)

I don't really believe this profling will really help in improving the
performance as it was already stated we knew that glDrawRangeElements
was the bottleneck :)
But, at least, it will provide some reference material for the SLDev
wiki. (it show the fact).

I'll follow with some more data, if i can fetch some usefull one.
If anyone want a trace log, or something specific data (filtered
trace, callbacks, stats), feel free to mail me. I don't want to spam
the list with a huge, probably useless, attached file.



-- 
Kerunix Flan
Laurent Laborde
-------------- next part --------------
GL Function;# of Calls;Total Time (?sec);Avg Time (?sec);% GL Time;% App Time
glDrawRangeElements;854?846;11808712;13.81;54.49;6.89
glDrawElements;303?525;2035441;6.71;9.39;1.19
glTexImage2D;1?167;1293682;1108.55;5.97;0.76
glFlush;8?172;1246932;152.59;5.75;0.73
CGLFlushDrawable;1?101;818632;743.54;3.78;0.48
glBegin;158?198;694418;4.39;3.20;0.41
glRotatef;888?733;317846;0.36;1.47;0.19
glBindBuffer;1?065?466;284342;0.27;1.31;0.17
glTexCoord2f;3?005?672;248307;0.08;1.15;0.14
glPushMatrix;891?582;244540;0.27;1.13;0.14
glVertex2f;2?082?215;225978;0.11;1.04;0.13
glBindTexture;403?024;173748;0.43;0.80;0.10
glBeginQuery;87?002;149853;1.72;0.69;0.09
glTexCoordPointer;810?931;134978;0.17;0.62;0.08
glDisable;534?216;126271;0.24;0.58;0.07
glPopMatrix;891?581;125898;0.14;0.58;0.07
glLightfv;766?243;115450;0.15;0.53;0.07
glEnable;406?205;110563;0.27;0.51;0.06
glClear;4?408;110555;25.08;0.51;0.06
glVertex2i;896?181;100018;0.11;0.46;0.06
glVertexPointer;640?267;99494;0.16;0.46;0.06
glTranslatef;614?619;98225;0.16;0.45;0.06
glClientActiveTexture;852?551;90761;0.11;0.42;0.05
glActiveTexture;675?121;90486;0.13;0.42;0.05
glNormalPointer;516?196;82387;0.16;0.38;0.05
glTexParameteri;100?094;78443;0.78;0.36;0.05
glColorPointer;458?195;70234;0.15;0.32;0.04
glScalef;365?916;68937;0.19;0.32;0.04
glEnd;158?198;47917;0.30;0.22;0.03
glLightf;230?535;41750;0.18;0.19;0.02
glMatrixMode;285?478;40708;0.14;0.19;0.02
glEndQuery;87?002;39439;0.45;0.18;0.02
glLightModelfv;89?597;39161;0.44;0.18;0.02
glGetQueryObjectuiv;86?894;31952;0.37;0.15;0.02
glBufferData;514;26376;51.32;0.12;0.02
glColor4fv;183?496;25505;0.14;0.12;0.01
glBufferSubData;376;24403;64.90;0.11;0.01
glDisableClientState;97?582;22570;0.23;0.10;0.01
glTexEnvi;122?610;21464;0.18;0.10;0.01
glMultMatrixf;30?434;19221;0.63;0.09;0.01
glMaterialfv;14?341;16517;1.15;0.08;0.01
glLoadIdentity;98?201;15652;0.16;0.07;0.01
glVertex2fv;154?140;15385;0.10;0.07;0.01
glDeleteTextures;96;13897;144.77;0.06;0.01
glCopyTexSubImage2D;1?102;12795;11.61;0.06;0.01
glBlendFunc;91?671;12675;0.14;0.06;0.01
glColor4ubv;71?318;12007;0.17;0.06;0.01
glAlphaFunc;79?733;10982;0.14;0.05;0.01
glEnableClientState;55?170;10779;0.20;0.05;0.01
glUniform2fvARB;3?306;10467;3.17;0.05;0.01
glUseProgramObjectARB;2?204;9641;4.37;0.04;0.01
glColor4f;49?496;8652;0.17;0.04;0.01
glMateriali;14?341;8432;0.59;0.04;0.00
glTexGeni;15?414;7876;0.51;0.04;0.00
glGetFloatv;5?513;6785;1.23;0.03;0.00
glDepthMask;48?883;6728;0.14;0.03;0.00
glGetDoublev;13?220;5377;0.41;0.02;0.00
glViewport;3?315;5076;1.53;0.02;0.00
glVertex3fv;38?675;4258;0.11;0.02;0.00
glColorMask;20?240;4000;0.20;0.02;0.00
glTexGenfv;8?808;3836;0.44;0.02;0.00
glFogfv;2?202;3357;1.52;0.02;0.00
glDeleteBuffers;9;3345;371.75;0.02;0.00
glGetIntegerv;8?817;3311;0.38;0.02;0.00
glVertex3f;1?105;3042;2.75;0.01;0.00
glLineWidth;17?476;2788;0.16;0.01;0.00
glUniform3fvARB;3?306;2580;0.78;0.01;0.00
glUniform1fARB;3?306;2535;0.77;0.01;0.00
glFrustum;2?206;2432;1.10;0.01;0.00
glFogf;4?404;2381;0.54;0.01;0.00
glLoadMatrixf;5?513;2344;0.43;0.01;0.00
glDepthFunc;8?824;2205;0.25;0.01;0.00
glOrtho;3?307;1779;0.54;0.01;0.00
glFogi;2?202;1771;0.80;0.01;0.00
glClipPlane;2?204;1709;0.78;0.01;0.00
glReadPixels;4;1595;398.81;0.01;0.00
glHint;2?202;1585;0.72;0.01;0.00
glGetTexLevelParameteriv;2?204;1396;0.63;0.01;0.00
glPointSize;2?202;1010;0.46;0.00;0.00
glPolygonMode;1?101;474;0.43;0.00;0.00
glScissor;1?101;375;0.34;0.00;0.00
glGenTextures;227;346;1.53;0.00;0.00
glTexParameterf;256;273;1.07;0.00;0.00
glGenBuffers;458;124;0.27;0.00;0.00
glGenQueries;22;10;0.49;0.00;0.00
glScaled;4;4;1.07;0.00;0.00
glTranslated;4;2;0.75;0.00;0.00
glClearColor;4;1;0.46;0.00;0.00


More information about the SLDev mailing list