-
Notifications
You must be signed in to change notification settings - Fork 152
[WIP] README updates for 0.7 #467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks. Not sure on when is best timing but we can merge this before JuliaCon. There's still a v0.6 version that will be in use for a while - we may even fix a bug or two - so I'd like to keep that around along with a v0.7 (or v1.0, soon I hope :) ) badge |
Out of curiousity, where is this at? |
I've just added a few more changes -- dropping the v0.5 badge, adding a v0.7 badge (which actually doesn't seem to be working yet: https://pkg.julialang.org/badges/StaticArrays_0.7.svg), and removing the outdated discussion on ImmutableArrays and FixedSizeArrays. I can squash the two commits if necessary. The "Speed" section still needs to be updated (I'm not sure which benchmark script was used to generate those results) and the reference therein to julia 0.5 removed. If the plan is to maintain an 0.6 branch (the closest thing at the moment is the v0.7.2 tag), maybe we should do something along the lines of the message at the top of the README here: https://github.com/timholy/Revise.jl. |
We should fix this up for v1.0 |
Note that SLP is on by default so any reference to |
Yes, there is a bit of out-of-date cruft in there. |
Currently this PR has 8 badges at the top. These are listed below with a proposal for what to do with each in parentheses. Thoughts/comments (especially on the dual code coverage badges) are welcome.
Other notes:
for N in 1:100
A = rand(N,N)
SA = SMatrix{N,N}(A)
speedup = (@belapsed $A*$A)/(@belapsed $SA*$SA)
println("$(N)x$(N): $speedup")
speedup < 1 && break
end
rand(MMatrix{20,20}) * rand(MMatrix{20,20}) # large matrices can use BLAS |
I like your suggestions here! |
Re. the "speed crossover" thing, it's important that people are a bit scared of large static matrices... compile times can be aweful and the amount of generated code means that practical workfloads will suffer compared to microbenchmarks due to instruction cache being tiny on CPUs. So those new benchmarks are Julia 1.0 on a Ryzen 1800X? I'd be interested to see what results we get from a modern Intel (for curiousity - I don't think the README necessarily needs to be "Intel Inside") |
FWIW, I don't think two documenter badges are needed. If you want the dev docs you can always use the dropdown menu. |
Especially since Here I tried something new: https://github.com/fredrikekre/Literate.jl/blob/master/README.md and put |
Looks good, on the next update I'll essentially just ape what you've got going on at the Unfortunately the only modern processor I have access to is my work machine (the Ryzen 1800X); I have a 2011 Macbook Pro with an Intel quad-core but I wouldn't exactly call that modern (it's definitely missing some newer SIMD stuff). If anyone reading this has a better option at hand, can you run using BenchmarkTools
using LinearAlgebra
using StaticArrays
add!(C, A, B) = (C .= A .+ B)
function simple_bench(N, T=Float64)
A = rand(T,N,N)
A = A'*A
B = copy(A)
SA = SMatrix{N,N}(A)
MA = MMatrix{N,N}(A)
MB = copy(MA)
print("""
============================================
Benchmarks for $N×$N $T matrices
============================================
""")
ops = [
("Matrix multiplication ", *, (A, A), (SA, SA)),
("Matrix multiplication (mutating) ", mul!, (B, A, A), (MB, MA, MA)),
("Matrix addition ", +, (A, A), (SA, SA)),
("Matrix addition (mutating) ", add!, (B, A, A), (MB, MA, MA)),
("Matrix determinant ", det, A, SA),
("Matrix inverse ", inv, A, SA),
("Matrix symmetric eigendecomposition", eigen, A, SA),
("Matrix Cholesky decomposition ", cholesky, A, SA)
]
for (name, op, Aargs, SAargs) in ops
if Aargs isa Tuple && length(Aargs) == 2
speedup = @belapsed($op($Aargs[1], $Aargs[2])) / @belapsed($op($SAargs[1], $SAargs[2]))
elseif Aargs isa Tuple && length(Aargs) == 3
speedup = @belapsed($op($Aargs[1], $Aargs[2], $Aargs[3])) / @belapsed($op($SAargs[1], $SAargs[2], $SAargs[3]))
else
speedup = @belapsed($op($Aargs)) / @belapsed($op($SAargs))
end
println(name*" -> $(round(speedup, digits=1))x speedup")
end
end
simple_bench(3) |
If I run your code on a i7-8650U Skylake I get
However, I just noted you are using BenchmarkTools.jl here. I do love BenchmarkTools, but in the past I was getting problems with it somehow doing less allocations for |
Julia 1.2 will optimize some of these benchmarks away, so use dereferencing of Ref's to at least prevent that particular error. Update the README a bit with these results.
This has been quietly bit-rotting for too long, so I took the liberty of rebasing and addressing Andy's comments — at least I hope — by using As with all microbenchmarks, the results are only somewhat indicative. So instead of really working hard on those right now I've just added a caveat in the documentation. The key point is that people should try |
Tangentially related, there are a large number of 3 years old .txt files in https://github.com/JuliaArrays/StaticArrays.jl/tree/master/perf. Should these just be removed? |
Quite possible, @andyferris would know if anyone does. Benchmark cleanup is probably a separate PR though. Ideally we'd do it systematically and regularly on a central machine but I'm skeptical that CI workers would work for that. Is there a way to integrate with the Base benchmarking infrastructure for widely used performance critical packages like StaticArrays? |
Thanks for getting this across the finish line! |
No problem, sorry it took such a long time! |
Since this affects the github front page of
StaticArrays.jl
these changes should probably be merged only once 0.7 is actually released.Regarding badges - do we want to keep the 0.5 and 0.6 passing badges up indefinitely?