In order to analyze your claims I did as following.
I created the following Julia file - RunTimeValidation.
It evaluates 4 ways to calculate a function run time:
- Use of the method I used in my project. Use
@elapsed
method per iteration. Save each iteration result to array. Use 7 iterations. It yielded minimum run time of1.4199402
[Sec]. In my project I usemedian()
yet in this I useminimum()
in order to match what’s done inBenchMarkTools.jl
I will compare to. - Use the method described in (1) just use 70 iterations instead of 7. In order to see if 7 gets stable enough. It yielded run time of
1.417183299
[Sec]. - Use
@belapsed
macro fromBenchmarkTools.jl
. It yielded run time of1.418070099
[Sec]. - Use
@btime
macro fromBenchmarkTools.jl
. It yielded run time of1.419
[Sec].
Methods (1)-(3) was executed within a function (The timed called).
Method (4) was executed with variable interpolation.
I ran the same program with smaller matrix size (100) to see if results are stable in that case as well (Small run time).
They were.
I ran it for Matrix size of 10, those are the results:
- 64.5 [Micro Sec].
- 65.1 [Micro Sec].
- 64.3 [Micro Sec].
- 64.8 [Micro Sec].
Since all methods turned to be stable within single digits of % I am pretty sure the method I used is valid.
Now, I think we can stop talk about the way time was measured and focus about the results.