Backtraces are currently non-functional in Julia 0.3 for windows -- that will be fixed whenever 0.3.1 binaries are created.
While `@profile` introduces no overhead to the code, it needs to make a few calls to the kernel and a bit of work to look up functions. On linux, this appears to be essentially free, on windows this is not (benchmarks appear to put windows at somewhere around 50_000x slower when calling the equivalent library functions) On Wed, Sep 17, 2014 at 12:56 AM, G. Patrick Mauroy <gpmau...@gmail.com> wrote: > I have a Julia code file containing the definition of a function I want to > profile, setting up test data, and running a function call (actually 2 > calls, one to compile the function, and one to actually measure its > performance, and optionally a third call to profile it). > > So my Julia test code is conceptually structured as follows: > >> >> function my_slow_func(a, b) >> <function body> >> return c::DataFrame >> end >> test_a = DataFrame(...) >> test_b = DataFrame(...) >> warmup_res = my_slow_func(test_a, test_b) >> @time perf_res = my_slow_func(test_a, test_b) >> > Profile.clear() > > @profile profile_res = my_slow_func(test_a, test_b) > > Profile.print() > > > The function call takes ~ 1.5 to 2 sec to run. It should be 2 orders of > magnitude faster to match R benchmarks. So I am trying to profile it. > > Pb. 1: When I run the function through the @profile, it runs much slower: > ~ 35sec. > From what I read about the profiler, it should not be that much slower. > Any idea what could be going wrong? > > Pb.2: Profile.print() dies. > When I run it through Juno/LightTable, I get an ECONNRESET exception. > Again, what am I doing wrong that I cannot get profile results? > > Can my function and test script be in the same file or should I have my > test function in its own file? Does it matter? > > The crash runs on Windows 7 64, Julia 0.3 (downloaded about a couple weeks > ago or so). I use the default profiler parameters. > > Tomorrow: > > 1. I can try running on Linux if it may help shed some light. > 2. I may also submit the details of my slow function if I cannot > figure out how to make it run much faster -- I am benchmarking against an R > test, granted optimized using data.table, it should nevertheless perform at > least in the same order of magnitude, not 2 orders of magnitude slower! I > would rather get a fair shot with the profiler's help before crying for > help! > > Thanks much in advance for any clue. > > Patrick > >