In order to see how profiling works, please perform these steps:
- Start with defining a function that we will use for profiling. You will also need to include the following contents within the profiletest.jl file:
using Statisticsfunction timeto1(mv) x = Int[] while true push!(x, rand(1:mv)) 1 in x && return length(x) endendagg(f, mv, rep) = mean(f(mv) for i in 1:rep)
- Measure the execution times for the preceding specified function:
julia> include("profiletest.jl");julia> @time agg(timeto1, 1000, 10_000); 6.422435 seconds (627.43 k allocations: 254.511 MiB, 0.95% gc time) julia> @time agg(timeto1, 1000, 10_000); 5.710283 seconds (96.25 k allocations: 223.124 MiB, 0.76% gc time)
- Check how much memory is used by the analyzed ...