Skip to main content
gamedev.net
🔒 Locked

Help with profiling

Started by formalproof Apr 7, 2009 at 8:14 PM 3 replies 2.3k views
Original Post
formalproof
formalproof
I'm trying to learn how to use a profiling tool. I have written an implementation of the LZW compression algorithm, but it is extremely slow, so I tried if I could find the bottleneck with AMD's CodeAnalyst. However, I have no idea how to interprete the results. My program is single-threaded and just loads an uncompressed file, compresses it and stores the result in a package file. This is what CodeAnalyst says (top 5): 15% of timer samples std::_Iterator_base::_Orphan_me() 7% std::_Iterator_base::_Adopt() 5% std::_Iterator_base::~_Iterator_base 4% std::_Iterator_base::operator= 4% _RTC_CheckStackVars Most of the other items in the list are std::iterator operations as well. Are these results normal? What does std::_Iterator_base::_Orphan_me() exactly do? Is it possible to say something about where the bottleneck/problem might be when looking at these results? Should I run some other kind of profiling tool/session? Is there a way to make CodeAnalyst display only how much time each function in my program takes, ignoring STL functions? Is there any other advice you could give me on how to proceed?
Sneftel
Sneftel
Looks like you have iterator debugging enabled. You aren't by any chance profiling in Debug mode, are you?
formalproof
formalproof
Quote:
Original post by Sneftel
Looks like you have iterator debugging enabled. You aren't by any chance profiling in Debug mode, are you?


Yes I am. I'll have a look what happens in release mode.

formalproof
formalproof
Ok, so it's obviously much faster now. Now the first item in the list is

40% std::operator< >

I wonder what exactly this is? Does someone have an idea of why it might be taking so much processor time and if it's normal?

BTW, I'm still curious about what Orphan_me() actually does? (I couldn't decipher that out of the source code) In general, is there an easy way to find out what a specific STL function such as this does, other than looking at the code directly?
Sneftel
Sneftel
Quote:
Original post by formalproof
Yes I am. I'll have a look what happens in release mode.

Profiling in debug mode is meaningless.
Quote:
40% std::operator< >
I wonder what exactly this is? Does someone have an idea of why it might be taking so much processor time and if it's normal?

Looks like string comparison, possibly for a std::map or for sorting. CodeAnalyst can be set to record full stack traces rather than simply giving you the top level function.... you should really do that.
Quote:
In general, is there an easy way to find out what a specific STL function such as this does, other than looking at the code directly?
No.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.