digitalmars.D.learn - Interesting line in the recent Dr Dobbs article about profiling?
- Gary Willoughby (5/10) Jul 25 2013 I've just read the article over at Dr Dobbs by Walter
- H. S. Teoh (16/29) Jul 25 2013 I can personally testify to the truth of this statement. All too often,
- Dmitry Olshansky (9/18) Jul 26 2013 I've found
I've just read the article over at Dr Dobbs by Walter http://www.drdobbs.com/cpp/increasing-compiler-speed-by-over-75/240158941 and this line caught my eye:Even if you know your code well, you're likely wrong about where the performance bottlenecks are. Use a profiler. If you haven't used one on your codebase in a while, it's highly likely there's a bottleneck in there that's fixable with just a few lines of code.What profilers do you use with D especially for Linux and Mac? I've been compiling with -profile and trying to grok the output.
Jul 25 2013
On Thu, Jul 25, 2013 at 08:15:42PM +0200, Gary Willoughby wrote:I've just read the article over at Dr Dobbs by Walter http://www.drdobbs.com/cpp/increasing-compiler-speed-by-over-75/240158941 and this line caught my eye:I can personally testify to the truth of this statement. All too often, too much time is spent "optimizing" parts of code that are actually irrelevant to the performance of the program, because the bottleneck lies elsewhere, often in an unexpected place. (Not to mention that such premature optimization makes your code harder to write, harder to read, harder to maintain, and therefore more prone to bugs.) I remember at least one instance in which a profiler immediately revealed an fprintf (this was C/C++ code, back in the day) where it shouldn't be, the removal of which instantly improved performance by at least 30%, probably more.Even if you know your code well, you're likely wrong about where the performance bottlenecks are. Use a profiler. If you haven't used one on your codebase in a while, it's highly likely there's a bottleneck in there that's fixable with just a few lines of code.What profilers do you use with D especially for Linux and Mac? I've been compiling with -profile and trying to grok the output.I use gdc with gprof, usually. I've only tried dmd -profile a few times. T -- I think Debian's doing something wrong, `apt-get install pesticide', doesn't seem to remove the bugs on my system! -- Mike Dresser
Jul 25 2013
25-Jul-2013 22:15, Gary Willoughby пишет:I've just read the article over at Dr Dobbs by Walter http://www.drdobbs.com/cpp/increasing-compiler-speed-by-over-75/240158941 and this line caught my eye:I've found valgrind --tool=callgrind + kcachegrind to be quite awesome. Other options are the usual profilers of your OS/CPU vendor: perf, AMD CodeAnalyst, Intel VTune -- Dmitry OlshanskyEven if you know your code well, you're likely wrong about where the performance bottlenecks are. Use a profiler. If you haven't used one on your codebase in a while, it's highly likely there's a bottleneck in there that's fixable with just a few lines of code.What profilers do you use with D especially for Linux and Mac? I've been compiling with -profile and trying to grok the output.
Jul 26 2013