Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Mention normalize in the manual
Browse files Browse the repository at this point in the history
  • Loading branch information
cstjean committed Aug 17, 2017
1 parent ab6debb commit 76ed7f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@
"\n",
"`measure(:@measuring_macro, trace)` applies the given _quoted_ macro (put a `:` in front of the `@`) to every function call in `trace`. Useful macros are `@allocated`, `@elapsed` and [BenchmarkTools](https://github.com/JuliaCI/BenchmarkTools.jl)' `@belapsed`. Because measuring involves rerunning the function calls in the trace, it can be slow. A good rule-of-thumb is to use the more accurate `@belapsed` when the code to profile takes less than half a second and the trace is relatively short, and `@elapsed` when it takes less than a minute. When the trace is very large, try the `explore_worst=true` option, which will only expand the worst callee of each call (so the runtime is $O(wd)$ instead of $O(w^d)$). You can also `prune` the trace first.\n",
"\n",
"Remember that due to timing fluctuations, even if `f(x)` calls `g(x)`, it does not imply that `@elapsed(f(x)) >= @elapsed(g(x))`."
"Remember that due to timing fluctuations, even if `f(x)` calls `g(x)`, it does not imply that `@elapsed(f(x)) >= @elapsed(g(x))`. `normalize(tr::Trace)` is useful when exploring the output of `measure`."
]
},
{
Expand Down Expand Up @@ -1081,7 +1081,7 @@
"trace_pycall = @trace PyCall math[:pi];\n",
"\n",
"using BenchmarkTools: @belapsed\n",
"measure(:@belapsed, trace_pycall; normalize=true, threshold=0.005) # only show calls that take >0.5% of total runtime"
"measure(:@belapsed, trace_pycall; normalize=true, threshold=0.005) # only show/explore calls that take >0.5% of total runtime"
]
},
{
Expand Down

0 comments on commit 76ed7f1

Please sign in to comment.