Skip to content

Conversation

@LilithHafner
Copy link
Member

I used th following benchmarks to decide that these @inline annotations are not helpful.

for T in (Float16, Float32, Float64), x in T[0, 17.3, T(π), floatmin(T), floatmax(T), typemax(T)]
    println(x)
    @btime string($x)
end

0.0
  49.887 ns (2 allocations: 104 bytes) => 48.581 ns (2 allocations: 104 bytes)
17.3
  93.893 ns (2 allocations: 104 bytes) => 94.695 ns (2 allocations: 104 bytes)
3.14
  94.357 ns (2 allocations: 104 bytes) => 95.120 ns (2 allocations: 104 bytes)
6.104e-5
  89.451 ns (2 allocations: 104 bytes) => 89.563 ns (2 allocations: 104 bytes)
6.55e4
  91.047 ns (2 allocations: 104 bytes) => 92.273 ns (2 allocations: 104 bytes)
Inf
  50.038 ns (2 allocations: 104 bytes) => 50.441 ns (2 allocations: 104 bytes)
0.0
  48.149 ns (2 allocations: 136 bytes) => 47.519 ns (2 allocations: 136 bytes)
17.3
  100.287 ns (2 allocations: 136 bytes) => 99.606 ns (2 allocations: 136 bytes)
3.1415927
  90.511 ns (2 allocations: 136 bytes) => 88.517 ns (2 allocations: 136 bytes)
1.1754944e-38
  84.935 ns (2 allocations: 136 bytes) => 84.355 ns (2 allocations: 136 bytes)
3.4028235e38
  85.075 ns (2 allocations: 136 bytes) => 82.979 ns (2 allocations: 136 bytes)
Inf
  48.673 ns (2 allocations: 136 bytes) => 47.587 ns (2 allocations: 136 bytes)
0.0
  60.720 ns (2 allocations: 432 bytes) => 59.582 ns (2 allocations: 432 bytes)
17.3
  110.734 ns (2 allocations: 432 bytes) => 110.788 ns (2 allocations: 432 bytes)
3.141592653589793
  96.990 ns (2 allocations: 432 bytes) => 95.462 ns (2 allocations: 432 bytes)
2.2250738585072014e-308
  88.259 ns (2 allocations: 432 bytes) => 90.646 ns (2 allocations: 432 bytes)
1.7976931348623157e308
  90.150 ns (2 allocations: 432 bytes) => 90.026 ns (2 allocations: 432 bytes)
Inf
  60.327 ns (2 allocations: 432 bytes) => 60.278 ns (2 allocations: 432 bytes)

@LilithHafner LilithHafner merged commit 3b5c058 into master Nov 4, 2022
@LilithHafner LilithHafner deleted the remove-inline branch November 4, 2022 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants