I was looking at display lists today and was not really seeing any performance increse from using them, so I ran the profiler on the BM Nehe 12 demo and a Cocoa Nehe 12 Demo.
I was very surprised to see that BM is creating lots of Display lists in fact 256 of them even if you don't use them in your own code.
Below is the output from BM run and Cocoa Run
First BM
GL Function;# of Calls;Total Time (µsec);Avg Time (µsec);% GL Time;% App Time
CGLFlushDrawable;3,128;3366938;1076.39;98.83;44.50
glGetDoublev;12,512;11302;0.90;0.33;0.15
glNewList;258;10420;40.39;0.31;0.14
glGetIntegerv;12,517;10238;0.82;0.30;0.14
glEndList;258;6872;26.64;0.20;0.09
glTexImage2D;1;897;897.64;0.03;0.01
glBindTexture;1;29;29.57;0.00;0.00
glViewport;1;26;26.53;0.00;0.00
glGenTextures;1;22;22.35;0.00;0.00
glGenLists;2;20;10.25;0.00;0.00
glTexParameteri;2;18;9.41;0.00;0.00
glPixelStorei;12;18;1.56;0.00;0.00
glGetBooleanv;2;3;1.57;0.00;0.00
CGLSetSurface;1;0;0.00;0.00;0.00
CGLSetParameter;3;0;0.00;0.00;0.00
Now Cocoa
GL Function;# of Calls;Total Time (µsec);Avg Time (µsec);% GL Time;% App Time
CGLFlushDrawable;1,386;632337;456.23;99.85;8.01
glTexImage2D;1;486;486.45;0.08;0.01
glEndList;2;103;51.98;0.02;0.00
glNewList;2;98;49.40;0.02;0.00
glViewport;1;71;71.72;0.01;0.00
glBindTexture;1;66;66.52;0.01;0.00
glGenTextures;1;25;25.66;0.00;0.00
glGenLists;1;25;25.39;0.00;0.00
glTexParameteri;2;20;10.15;0.00;0.00
glFrustum;1;18;18.39;0.00;0.00
glMatrixMode;2;16;8.17;0.00;0.00
glLoadIdentity;2;12;6.10;0.00;0.00
CGLUpdateContext;1;0;0.00;0.00;0.00
CGLSetSurface;1;0;0.00;0.00;0.00
CGLSetParameter;1;0;0.00;0.00;0.00
The calls to glNewList are 258 in BM 256 + 2 from the app
The calls to glNewList are 2 in Cocoa
I have done a few simple tests and when I use display lists the frame rate does not really change that much and now I have got sidelined looking at why BM is creating things I do not need or want, and possible may even use up some memory.
I was wondering if anyone has any ideas on this or Mark might be able to explain this to me.
I was very surprised to see that BM is creating lots of Display lists in fact 256 of them even if you don't use them in your own code.
Below is the output from BM run and Cocoa Run
First BM
GL Function;# of Calls;Total Time (µsec);Avg Time (µsec);% GL Time;% App Time
CGLFlushDrawable;3,128;3366938;1076.39;98.83;44.50
glGetDoublev;12,512;11302;0.90;0.33;0.15
glNewList;258;10420;40.39;0.31;0.14
glGetIntegerv;12,517;10238;0.82;0.30;0.14
glEndList;258;6872;26.64;0.20;0.09
glTexImage2D;1;897;897.64;0.03;0.01
glBindTexture;1;29;29.57;0.00;0.00
glViewport;1;26;26.53;0.00;0.00
glGenTextures;1;22;22.35;0.00;0.00
glGenLists;2;20;10.25;0.00;0.00
glTexParameteri;2;18;9.41;0.00;0.00
glPixelStorei;12;18;1.56;0.00;0.00
glGetBooleanv;2;3;1.57;0.00;0.00
CGLSetSurface;1;0;0.00;0.00;0.00
CGLSetParameter;3;0;0.00;0.00;0.00
Now Cocoa
GL Function;# of Calls;Total Time (µsec);Avg Time (µsec);% GL Time;% App Time
CGLFlushDrawable;1,386;632337;456.23;99.85;8.01
glTexImage2D;1;486;486.45;0.08;0.01
glEndList;2;103;51.98;0.02;0.00
glNewList;2;98;49.40;0.02;0.00
glViewport;1;71;71.72;0.01;0.00
glBindTexture;1;66;66.52;0.01;0.00
glGenTextures;1;25;25.66;0.00;0.00
glGenLists;1;25;25.39;0.00;0.00
glTexParameteri;2;20;10.15;0.00;0.00
glFrustum;1;18;18.39;0.00;0.00
glMatrixMode;2;16;8.17;0.00;0.00
glLoadIdentity;2;12;6.10;0.00;0.00
CGLUpdateContext;1;0;0.00;0.00;0.00
CGLSetSurface;1;0;0.00;0.00;0.00
CGLSetParameter;1;0;0.00;0.00;0.00
The calls to glNewList are 258 in BM 256 + 2 from the app
The calls to glNewList are 2 in Cocoa
I have done a few simple tests and when I use display lists the frame rate does not really change that much and now I have got sidelined looking at why BM is creating things I do not need or want, and possible may even use up some memory.
I was wondering if anyone has any ideas on this or Mark might be able to explain this to me.