Sign in to follow this  
MajinMusashi

OpenGL Performance question - display lists

Recommended Posts

Hi all (again)! I'm working on a demo to learn OpenGL, it's still in the initial development phases, and it's very slow (no vertex arrays, vbo or display lists). In order to get some additional frames per second, I tried to put the platform and background drawing codes (VC6 project and source files included bellow) inside display lists, still, I couldn't notice any changes. Question: Does the usage of display lists really increase general performance? I've always read that it does, but it seems to me that it's not true (maybe I'm doing it the wrong way?). Code used:
// Initializing stage
GLuint platformList;
platformList = glGenLists(1);
glNewList( platformList, GL_COMPILE );
    // Many glVertex3f, glNormal and glTexCoord2f here
    // Platform is lit textured cube
glEndList();

// Drawing stage
glCallList( platformList );


Thanks! Source + EXE [Edited by - MajinMusashi on November 29, 2004 1:50:06 PM]

Share this post


Link to post
Share on other sites
You should compile the display list once, and then repeatedly call that list. Re-compiling the list per-frame will essentially be the same as before, quite possibly slower.

- carb

Share this post


Link to post
Share on other sites
>>Does the usage of display lists really increase general performance? I've always read that it does,<<

no it doesnt, it will only increase performance when u have a certain situations check performance FAQs for details on how to find the bottleneck in your app. FWIW ive found with reasonable shaders the bottleneck aint the polygon rendering method eg immediate/DL/VA/VBO all render the same speed but are limited by the length/complexity of the shader

Share this post


Link to post
Share on other sites
Quote:
Original post by carb
You should compile the display list once, and then repeatedly call that list. Re-compiling the list per-frame will essentially be the same as before, quite possibly slower.
- carb


Note that I've written "Initialization Stage" and "Drawing Stage", and the compilation process is in the initialization stage, then I compile the list just once, and call it for every frame.

Thanks!

Share this post


Link to post
Share on other sites
Quote:
no it doesnt, it will only increase performance when u have a certain situations check performance FAQs for details on how to find the bottleneck in your app. FWIW ive found with reasonable shaders the bottleneck aint the polygon rendering method eg immediate/DL/VA/VBO all render the same speed but are limited by the length/complexity of the shader

Are you trying to say that for newbie programmers like me Display Lists are not that super that people usually say? Could you tell me what are the ideal situations to perceive a certain performance boost?

Thanks!!

Share this post


Link to post
Share on other sites
>>Are you trying to say that for newbie programmers like me Display Lists are not that super that people usually say?<<

depends on what youre doing, eg in my app that im working on at present, everythings the same speed (though DL's have the downside of using up memory)

>>Could you tell me what are the ideal situations to perceive a certain performance boost?<<

a case that DL's like, drawing lots of verts with no complicated shaders/states to a small screen.

eg i just a ran a small benchmark
(317.8 inds/sec) ( 56.6 v/sec)(105.9 t/sec)TRIS vertex3f GLushort DL
(307.2 inds/sec) ( 54.7 v/sec)(102.4 t/sec)TRIS vertex3f GLushort VBO
(306.1 inds/sec) ( 54.5 v/sec)(102.0 t/sec)TRIS vertex3f GLushort VBO (range)
(304.9 inds/sec) ( 54.3 v/sec)(101.6 t/sec)TRIS vertex3f GLuint VBO (range)
(303.8 inds/sec) ( 54.1 v/sec)(101.3 t/sec)TRIS vertex3f GLuint VBO
(253.0 inds/sec) ( 45.0 v/sec)( 84.3 t/sec)TRIS vertex3f GLuint DL
(205.9 inds/sec) ( 36.6 v/sec)( 68.6 t/sec)TRIS vertex3f GLushort VA (range)
(205.9 inds/sec) ( 36.6 v/sec)( 68.6 t/sec)TRIS vertex3f GLuint VA (range)
(142.3 inds/sec) ( 25.3 v/sec)( 47.4 t/sec)TRIS vertex3f GLushort VA
(141.8 inds/sec) ( 25.2 v/sec)( 47.3 t/sec)TRIS vertex3f GLuint VA
( 45.4 inds/sec) ( 8.1 v/sec)( 15.1 t/sec)TRIS vertex3f GLuint IMMED
( 45.1 inds/sec) ( 8.0 v/sec)( 15.0 t/sec)TRIS vertex3f GLushort IMMED

as u can see immediate is the slowest here BUT keep in mind this is not a real world app

Share this post


Link to post
Share on other sites
Display Lists are not guaranteed to give a speed boost. They do, however, give the drivers a chance to increase performance. However , most modern 3D drivers will attempt to.

What zedgeek was saying was that if you can send data to the graphics card faster than it can process it, no matter how much you improve the speed of sending data to the card you will see no improvement.

One way this could be happening, is that if it takes longer to clear the screen than if does for you do to send the data to it, and the sending of the data is overlapped with the clearing of the screen, then you get the following effect:


Without display lists:
clear: *****************
send : **********
draw : *******

With display lists:
clear: *****************
send : ****
draw : *******



No matter how much you speed up the send operation, because it's not the limiting factor (the bottleneck), you'll never get a speedup. It's not to do with whether you are a newbie or not.

You need to find the limiting factor and fix that. Get something working and then optimise.

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
check performance FAQs for details on how to find the bottleneck in your app.


See the first few pages of the performance pdf in my sig for a flow chart on how to find the slowest part (only a few will be applicable to you however)

[Edited by - _the_phantom_ on November 30, 2004 11:41:33 AM]

Share this post


Link to post
Share on other sites
Quote:
See the first few pages of the performance pdf in my sig for a flow chart on how to find the slowest part (only a few will be applicable to you however)


What signature? :) I found it in another post, and I already knew it, but as you say, only a few hints are applicable to me.

Thanks!!!

Share this post


Link to post
Share on other sites
Quote:
Original post by zedzeek
>>Are you trying to say that for newbie programmers like me Display Lists are not that super that people usually say?<<

depends on what youre doing, eg in my app that im working on at present, everythings the same speed (though DL's have the downside of using up memory)

>>Could you tell me what are the ideal situations to perceive a certain performance boost?<<

a case that DL's like, drawing lots of verts with no complicated shaders/states to a small screen.

eg i just a ran a small benchmark
(317.8 inds/sec) ( 56.6 v/sec)(105.9 t/sec)TRIS vertex3f GLushort DL
(307.2 inds/sec) ( 54.7 v/sec)(102.4 t/sec)TRIS vertex3f GLushort VBO
(306.1 inds/sec) ( 54.5 v/sec)(102.0 t/sec)TRIS vertex3f GLushort VBO (range)
(304.9 inds/sec) ( 54.3 v/sec)(101.6 t/sec)TRIS vertex3f GLuint VBO (range)
(303.8 inds/sec) ( 54.1 v/sec)(101.3 t/sec)TRIS vertex3f GLuint VBO
(253.0 inds/sec) ( 45.0 v/sec)( 84.3 t/sec)TRIS vertex3f GLuint DL
(205.9 inds/sec) ( 36.6 v/sec)( 68.6 t/sec)TRIS vertex3f GLushort VA (range)
(205.9 inds/sec) ( 36.6 v/sec)( 68.6 t/sec)TRIS vertex3f GLuint VA (range)
(142.3 inds/sec) ( 25.3 v/sec)( 47.4 t/sec)TRIS vertex3f GLushort VA
(141.8 inds/sec) ( 25.2 v/sec)( 47.3 t/sec)TRIS vertex3f GLuint VA
( 45.4 inds/sec) ( 8.1 v/sec)( 15.1 t/sec)TRIS vertex3f GLuint IMMED
( 45.1 inds/sec) ( 8.0 v/sec)( 15.0 t/sec)TRIS vertex3f GLushort IMMED

as u can see immediate is the slowest here BUT keep in mind this is not a real world app


Very interesting! Thanks,Zedzeek!

Share this post


Link to post
Share on other sites
Quote:
Original post by LucidIon
Display Lists are not guaranteed to give a speed boost. They do, however, give the drivers a chance to increase performance. However , most modern 3D drivers will attempt to.
...
You need to find the limiting factor and fix that. Get something working and then optimise.


Great! I love you all :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this