@@ -83,6 +83,42 @@ julia> besselk1x(1.0f0)
83
83
84
84
# Benchmarks
85
85
86
+ ``` julia
87
+ # Bessels.jl
88
+ julia> @benchmark besselj0 (x) setup= (x= 100.0 * rand ())
89
+ BenchmarkTools. Trial: 10000 samples with 999 evaluations.
90
+ Range (min … max): 7.465 ns … 28.946 ns ┊ GC (min … max): 0.00 % … 0.00 %
91
+ Time (median): 25.860 ns ┊ GC (median): 0.00 %
92
+ Time (mean ± σ): 24.915 ns ± 4.090 ns ┊ GC (mean ± σ): 0.00 % ± 0.00 %
93
+ Memory estimate: 0 bytes, allocs estimate: 0.
94
+
95
+ # SpecialFunctions.jl
96
+ julia> @benchmark besselj0 (x) setup= (x= 100.0 * rand ())
97
+ BenchmarkTools. Trial: 10000 samples with 999 evaluations.
98
+ Range (min … max): 9.050 ns … 79.412 ns ┊ GC (min … max): 0.00 % … 0.00 %
99
+ Time (median): 51.677 ns ┊ GC (median): 0.00 %
100
+ Time (mean ± σ): 51.029 ns ± 5.653 ns ┊ GC (mean ± σ): 0.00 % ± 0.00 %
101
+ Memory estimate: 0 bytes, allocs estimate: 0.
102
+ ```
103
+
104
+ ``` julia
105
+ # Bessels.jl
106
+ julia> @benchmark besselk1 (x) setup= (x= 100.0 * rand ())
107
+ BenchmarkTools. Trial: 10000 samples with 988 evaluations.
108
+ Range (min … max): 47.781 ns … 97.672 ns ┊ GC (min … max): 0.00 % … 0.00 %
109
+ Time (median): 47.950 ns ┊ GC (median): 0.00 %
110
+ Time (mean ± σ): 48.495 ns ± 2.656 ns ┊ GC (mean ± σ): 0.00 % ± 0.00 %
111
+ Memory estimate: 0 bytes, allocs estimate: 0.
112
+
113
+ # SpecialFunctions.jl
114
+ julia> @benchmark besselk (1 , x) setup= (x= 10.0 * rand ())
115
+ BenchmarkTools. Trial: 10000 samples with 681 evaluations.
116
+ Range (min … max): 184.962 ns … 2.122 μs ┊ GC (min … max): 0.00 % … 81.41 %
117
+ Time (median): 377.081 ns ┊ GC (median): 0.00 %
118
+ Time (mean ± σ): 388.243 ns ± 96.971 ns ┊ GC (mean ± σ): 0.04 % ± 0.81 %
119
+ Memory estimate: 16 bytes, allocs estimate: 1.
120
+ ```
121
+
86
122
Comparing the relative speed (` SpecialFunctions.jl / Bessels.jl ` ) for a vector of values between 0 and 100.
87
123
88
124
## Float32
0 commit comments