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
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.
When compiled with -inline, the profiler does not report the
On Saturday, 21 January 2017 at 12:33:57 UTC, albert-j wrote:
Now I dmd -profile it and look at the performance of funcA with
d-profile-viewer. Inside funcA, only 20% of time is spend in
funcB, but the rest 80% is self-time of funcA. How is it
possible, when funcB has three times the
Let's say I want to create an array of random numbers and do some
operations on them:
void main() {
import std.random;
//Generate array of random numbers
int arrSize = 1;
double[] arr = new double[](arrSize);
foreach (i; 0..arrSize)
arr[i] = uniform01();