#profiling? how?
1 messages · Page 1 of 1 (latest)
If you're on Mac, XCode Instrument works well, though it seems hit or miss whether you'll get debug symbols or not:
https://github.com/ziglang/zig/issues/14199
I am indeed on macos I'll give that a try
oof I don't have xcode installed
19gb later... 😛
are there any guides out there for profiling?
With Xcode? start the executable and attached Instrument to it, it's pretty straightforward. Any guide on profiling using xcode (not necessarily Zig) will probably be useful.
so basically just make sure I build in debug mode and use that bin?
are there any lighter alternatives to xcode on mac? I'll setup xcode if I have to, was just wondering if there's something less...crazy....
I'm running xcode now. In the cpu profiler, what are mc and gc units?
pretty sure it's cycles. Megacycles, gigacycles... You essentially want to drill down the largest %, double click to see the code...see where most of the samples are from...and then drill down into that and so on
ahh ok
I've already found a couple easy wins
std.math.pow(n, 2) is significantly slower than n * n
I've got to be doing something highly unoptimal still
because my javascript implementation takes about 23s, and zig takes about 14s
definitely an improvement but I would have expected zig to just absolutely destroy js in this highly cpu bound problem
I'm assuming zig run -O ReleaseFast src/main.zig will rebuild my bin in releasefast mode, even if I've already built it in debug mode?
Ya.
does the 0.11 build boast any big perf gains over 0.10? I'm still on 0.10