Skip to content

Commit 6ea234d

Browse files
committed
docs
1 parent b2eef85 commit 6ea234d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/intro.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ mat1k = rand(3,1000);
4747

4848
On recent versions of Julia, `mapcols` has become much faster, 5-10 times.
4949

50+
FWIW, times on Julia 1.7-dev & and M1 mac, April 2021:
51+
52+
```
53+
@btime mapreduce(fun, hcat, eachcol($mat1k)) # 616.250 μs (2317 allocations: 11.69 MiB)
54+
@btime mapslices(fun, $mat1k, dims=1) # 230.250 μs (7499 allocations: 298.23 KiB)
55+
@btime mapcols(fun, $mat1k) # 26.750 μs (1003 allocations: 140.83 KiB)
56+
@btime MapCols{3}(fun, $mat1k) # 6.067 μs (9 allocations: 47.20 KiB)
57+
@btime MapCols(fun, $mat1k) # 6.217 μs (9 allocations: 47.20 KiB)
58+
59+
@btime ForwardDiff.gradient(m -> sum(mapslices(fun, m, dims=1)), $mat1k); # 70.815 ms (1877210 allocations: 210.64 MiB)
60+
@btime Tracker.gradient(m -> sum(mapcols(fun, m)), $mat1k); # 29.840 ms (598046 allocations: 26.20 MiB)
61+
@btime Tracker.gradient(m -> sum(MapCols{3}(fun, m)), $mat1k); # 25.833 μs (60 allocations: 283.23 KiB)
62+
```
63+
5064
## Other packages
5165

5266
This package also provides Zygote gradients for the Slice/Align functions in

0 commit comments

Comments
 (0)