From 4482ea6bb608a4f804775480ceaa55da1985a2e4 Mon Sep 17 00:00:00 2001 From: Ian Date: Tue, 23 Feb 2021 18:37:58 -0500 Subject: [PATCH] add explanation about top-level compilation to timing macros [skip ci] --- base/timing.jl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/base/timing.jl b/base/timing.jl index 976bda7962676..7af6f038ba6ea 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -172,6 +172,10 @@ allocations, and the total number of bytes its execution caused to be allocated, returning the value of the expression. Any time spent garbage collecting (gc) or compiling is shown as a percentage. +In some cases the system will look inside the `@time` expression and compile some of the +called code before execution of the top-level expression begins. When that happens, some +compilation time will not be counted. To include this time you can run `@time @eval ...`. + See also [`@timev`](@ref), [`@timed`](@ref), [`@elapsed`](@ref), and [`@allocated`](@ref). @@ -264,6 +268,10 @@ end A macro to evaluate an expression, discarding the resulting value, instead returning the number of seconds it took to execute as a floating-point number. +In some cases the system will look inside the `@elapsed` expression and compile some of the +called code before execution of the top-level expression begins. When that happens, some +compilation time will not be counted. To include this time you can run `@elapsed @eval ...`. + See also [`@time`](@ref), [`@timev`](@ref), [`@timed`](@ref), and [`@allocated`](@ref). @@ -323,6 +331,10 @@ A macro to execute an expression, and return the value of the expression, elapse total bytes allocated, garbage collection time, and an object with various memory allocation counters. +In some cases the system will look inside the `@timed` expression and compile some of the +called code before execution of the top-level expression begins. When that happens, some +compilation time will not be counted. To include this time you can run `@timed @eval ...`. + See also [`@time`](@ref), [`@timev`](@ref), [`@elapsed`](@ref), and [`@allocated`](@ref).