Skip to content

Commit 41b9e61

Browse files
authored
Update timings from better literal_pow
1 parent bece5e9 commit 41b9e61

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ julia> unitful = convert(Unitful.Quantity, dyn_uni)
3939
julia> f(x, i) = x ^ i * 0.3;
4040

4141
julia> @btime f($dyn_uni, 1);
42-
8.759 ns (0 allocations: 0 bytes)
42+
2.750 ns (0 allocations: 0 bytes)
4343

4444
julia> @btime f($unitful, 1);
45-
30.083 μs (42 allocations: 1.91 KiB)
45+
2.718 μs (30 allocations: 1.34 KiB)
4646
```
4747

48-
**(Note the μ and n.)**
48+
**Note the μ and n: this is a 1000x speedup!**
4949
Here, the DynamicQuantities quantity object allows the compiler to build a function that is type stable,
5050
while the Unitful quantity object, which stores its dimensions in the type, requires type inference at runtime.
5151

@@ -56,10 +56,10 @@ then you can get better speeds with Unitful:
5656
julia> g(x) = x ^ 2 * 0.3;
5757

5858
julia> @btime g($dyn_uni);
59-
10.051 ns (0 allocations: 0 bytes)
59+
1.875 ns (0 allocations: 0 bytes)
6060

6161
julia> @btime g($unitful);
62-
2.000 ns (0 allocations: 0 bytes)
62+
1.500 ns (0 allocations: 0 bytes)
6363
```
6464

6565
While both of these are type stable,

0 commit comments

Comments
 (0)