Beginner's guide to graphical profiling

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Beginner's guide to graphical profiling

Post by matthewlai »

bob wrote:
matthewlai wrote:
bob wrote: Only thing I would add is that leaving off optimization will drastically skew the results and lead you down the wrong path frequently. I've not found that optimization causes any profiling problems if you are simply looking at the top level (as you are) to see which procedures are the heavy-hitters. If you want to look inside a procedure to specific lines of code, optimization confuses things of course.
Yeah that would depend on the program. I found -Os to be a good compromise because it's almost as fast as -O3, but doesn't do function inlining (except for very tiny functions).
I guess I don't understand your "don't do other optimizations". -O anything (other than 0) is a massive optimization anyway and makes it impossible to profile at the source line level.
I included -Os in the command already, so I meant not to enable other optimizations beyond that.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Beginner's guide to graphical profiling

Post by bob »

matthewlai wrote:
bob wrote:
matthewlai wrote:
bob wrote: Only thing I would add is that leaving off optimization will drastically skew the results and lead you down the wrong path frequently. I've not found that optimization causes any profiling problems if you are simply looking at the top level (as you are) to see which procedures are the heavy-hitters. If you want to look inside a procedure to specific lines of code, optimization confuses things of course.
Yeah that would depend on the program. I found -Os to be a good compromise because it's almost as fast as -O3, but doesn't do function inlining (except for very tiny functions).
I guess I don't understand your "don't do other optimizations". -O anything (other than 0) is a massive optimization anyway and makes it impossible to profile at the source line level.
I included -Os in the command already, so I meant not to enable other optimizations beyond that.
That's the biggee, so what other optimizations would cause issues other than inlining?
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: Beginner's guide to graphical profiling

Post by matthewlai »

bob wrote:
matthewlai wrote:
bob wrote:
matthewlai wrote:
bob wrote: Only thing I would add is that leaving off optimization will drastically skew the results and lead you down the wrong path frequently. I've not found that optimization causes any profiling problems if you are simply looking at the top level (as you are) to see which procedures are the heavy-hitters. If you want to look inside a procedure to specific lines of code, optimization confuses things of course.
Yeah that would depend on the program. I found -Os to be a good compromise because it's almost as fast as -O3, but doesn't do function inlining (except for very tiny functions).
I guess I don't understand your "don't do other optimizations". -O anything (other than 0) is a massive optimization anyway and makes it impossible to profile at the source line level.
I included -Os in the command already, so I meant not to enable other optimizations beyond that.
That's the biggee, so what other optimizations would cause issues other than inlining?
I don't think there's anything else.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.