What is the proper way to benchmark a using statement?

AwesomeQuest
Thu, 19 Jun 2025 15:09:50 +0000
General Usage

If calling a using statement for the first time since restart, it takes longer than calling after that in a different Julia instance:
First instance since restart

julia> @time using SpecialFunctions
  1.596852 seconds (68.60 k allocations: 4.347 MiB, 0.33% compilation time)

Second instance

julia> @time using SpecialFunctions
  0.188694 seconds (84.58 k allocations: 5.072 MiB, 5.71% compilation time)

So what is the proper to benchmark the time it takes to call using on a module? Do you actually have to restart the computer every time to get an accurate measurement?

10 posts - 8 participants