Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

alex997

Bottleneck detection

This topic is 5446 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I posted this in the NeHe forum but didnlt have much luck, so here it is again... I was wondering what methods there are for detecting the bottleneck in an OpenGL program? It''s out of personal interest for future reference, but I thought it''d make interesting reading for anyone else here if we compile a summary. The one I can think of is running the app in a window and resizing it. If decreasing the size of the window increases the framerate, the program is fill-rate limited, and is probably suffering from overdraw. AFAIK, a possible remedy is to draw the nearest objects first and let the depth-buffer do some culling. Alternatively just do anything to reduce the number of polys (space partitioning etc). I''m fairly new to this so I welcome any corrections to the above! What other tests are there that might show a bottleneck?

Share this post


Link to post
Share on other sites
Advertisement
If you're using Microsoft Visual C++ 6.0/.NET, then you have an option called profiling. Basically, you enable profiling, run your program, and after it closes, MSVC creates a list of the functions your program called and how long (in milliseconds) it took each of them to execute.

To enable profiling, open Project->Settings... and navigate to the Link tab. Check the checkboxes marked "Enable profiling" and "Generate mapfile". Then, compile your program, and click Build->Profile... Make sure "Function timing" selected. It helps if you split your program into functions, so then you can see which function is taking the most time to run. That's your bottleneck.

As regards OpenGL: it's always best to send as few vertices to the GL as possible. Frustum culling can increase a program's speed exponentially by not drawing polygons which are out of the frustum. Likewise, BSP, octree or quadtree systems also limit the number of polygons being sent to OpenGL. However, the depth buffer won't help at all with polygon culling and program speed. The depth buffer is there to sort which pixels of which polygons are actually visible to the user at a given position. Even polygons which are completely hidden by others still have to have their vertices processed by OpenGL. Just because they're not visible doesn't mean they're not there...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on August 19, 2003 7:48:17 AM]

Share this post


Link to post
Share on other sites
Is there a profiling tool in VS.NET? I haven't found it?!

NVidia has some docs for increasing performance and detecting bottlenecks. It can be found at their developer site:

http://developer.nvidia.com/docs/io/4000/GDC2003_OGL_Performance.pdf

http://developer.nvidia.com/docs/io/4000/GDC2003_PipelinePerformance.pdf

[edited by - ALiENiD on August 19, 2003 8:01:26 AM]

Share this post


Link to post
Share on other sites
Maybe you''re using one of the stripped down versions? Like say, evaluation edition, educational edition or other?

Share this post


Link to post
Share on other sites
Profiling is not a Visual Studio.NET feature, it's a feature of C++, so you'll only find it in Visual C++.NET. I made the instructions above as clear as possible, but they are for MSVC++ 6.0. I can't vouch for MSVC.NET, as I'm not using. I assumed it had it, based on some stuff I read about it, but I could be wrong. However, profiling is a very useful tool, I can't see Microsoft omitting it in .NET. Look through your MSDN stuff.

Open a project (a Windows project), and go to the Project menu. Open Settings... Alt+F7. Click the Link tab, and look for the profiling checkbox...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on August 19, 2003 8:28:07 AM]

Share this post


Link to post
Share on other sites
I had Visual C++ 6.0 before and the profiler worked great. Unfortunatly, I can''t find one in VC++.NET

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!