Skip to content

Commit 42dc7ce

Browse files
committed
Updated benchmark
1 parent 59c6e07 commit 42dc7ce

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

docs/src/why.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,16 @@ julia> n = 10000000
164164
10000000
165165

166166
julia> @benchmark estimate_pi(n)
167-
BenchmarkTools.Trial:
168-
memory estimate: 16 bytes
169-
allocs estimate: 1
170-
--------------
171-
minimum time: 86.532 ms (0.00% GC)
172-
median time: 93.298 ms (0.00% GC)
173-
mean time: 95.266 ms (0.00% GC)
174-
maximum time: 112.988 ms (0.00% GC)
175-
--------------
176-
samples: 53
177-
evals/sample: 1
167+
BenchmarkTools.Trial: 56 samples with 1 evaluation.
168+
Range (min max): 86.735 ms 94.346 ms ┊ GC (min max): 0.00% 0.00%
169+
Time (median): 89.119 ms ┊ GC (median): 0.00%
170+
Time (mean ± σ): 89.358 ms ± 1.659 ms ┊ GC (mean ± σ): 0.00% ± 0.00%
171+
172+
▁ ▃ █
173+
▄▁▄▇▁▇▇▁▁▄▄▄▄▄▄█▄▄▁█▄▄▁█▇▇▄▁▁▁▄▄▁▁▇▇▁▇▁▇▄▁▄▁▁▁▁▄▄▁▇▁▁▁▁▄▄▁▄ ▁
174+
86.7 ms Histogram: frequency by time 92.7 ms <
175+
176+
Memory estimate: 16 bytes, allocs estimate: 1.
178177
```
179178

180-
We see that the average computation time is **95** milliseconds. Without any modifications, the Julia code is slightly faster than the Python implementation with Numba. Even though the performance gap is not large, the Numba package will only work on a small Python and NumPy functionalities subset. Of course, other packages such as Cython can be used to increase performance. But all these packages have the same problem as Numba and will not support all Python functionalities. Python was not designed to be compiled, which results in many limitations that can not be easily solved. On the other hand, Julia was designed to be fast and provide high-performance without taking any additional steps. Moreover, Julia performance is not restricted to a subset of the language as in the case of Numba and other similar packages.
179+
We see that the average computation time is **89** milliseconds. Without any modifications, the Julia code is slightly faster than the Python implementation with Numba. Even though the performance gap is not large, the Numba package will only work on a small Python and NumPy functionalities subset. Of course, other packages such as Cython can be used to increase performance. But all these packages have the same problem as Numba and will not support all Python functionalities. Python was not designed to be compiled, which results in many limitations that can not be easily solved. On the other hand, Julia was designed to be fast and provide high-performance without taking any additional steps. Moreover, Julia performance is not restricted to a subset of the language as in the case of Numba and other similar packages.

0 commit comments

Comments
 (0)