> It might also be worth trying out the DevTools.jl profiler: > https://github.com/JunoLab/DevTools.jl
A poor man's version of the functionality in the last image in DevTools's readme is: https://github.com/mauro3/ProfileFile.jl Running this julia> @profile f(10^7); julia> using ProfileFile julia> ProfileFile.write_to_file() will produce a *.jl.pro file for *.jl file where f is defined. It writes the number of profiler hits per line: - function f(n) - out = 0.0 18 for i =1:n 2402 out += sin(i) - end - return out - end i.e. similar to the .cov and .mem files. For a while, I've been meaning to clean this up and put a pull request together... maybe this year... > On Thu, 31 Dec 2015 at 19:32 Tim Holy <[email protected]> wrote: > >> If I understand what you're asking, Profile.print(format=:flat) should do >> the >> trick. >> >> --Tim >> >> On Thursday, December 31, 2015 07:56:37 AM Cedric St-Jean wrote: >> > I like ProfileView.jl a lot, but there are times where a traditional flat >> > profiling output with `cumulative` would be more appropriate (eg. if I >> have >> > 10 expensive functions with 10 call sites each, it's hard to tell which >> > function to optimize in a heavily nested ProfileView visualization). >> > Profile.print gives me how many samples landed in this function exactly, >> > but I would like to know for each function F how many samples were caught >> > while F was on the call stack. Is there an easy way to get that? >> > >> > Cédric >> >>
