Profiling calls to small functions

albert-j via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 22 21:53:42 PST 2017


> I'm not sure if it's what happening in this case but, in code 
> as simple as this, function calls can sometimes be the 
> bottleneck. You should see how compiling with/without -O 
> affects performance, and adding `pragma(inline)` to funcB.

I guess my question is whether it is possible to have meaningful 
profiling results for this case, given a large cost of calling 
funcB? In release builds funcA and funcB are inlined, so profiler 
cannot report on them individually (is it correct, or am I 
misusing the profiler?). Profiling without inlining will show a 
large cost of calling funcB, but this cost will not be there in a 
release build, so the profiling results are irrelevant.


More information about the Digitalmars-d-learn mailing list