-
Notifications
You must be signed in to change notification settings - Fork 25
Cache divgcd(::Int8, ::Int8)
#9
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
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
I've convinced myself that the right type here is actually a |
Wow, check out the speeds here! So caching the gcd is enough to make normal |
I do think the best option would be to parametrize the Dimensions type by this choice. And just have the default be |
The type piracy here isn't great but the performance is. One improvement here is that you can make the table 2x smaller by making |
Surprisingly it is slower. I guess the |
f1866c3
to
a291973
Compare
a291973
to
315f430
Compare
@oscardssmith two new changes:
The speed goes down a bit, but it's so much safer than normal Ratios.jl that I think this is worth it. When you have a chance could you maybe try to get |
will do |
Superseded by the faster & cleaner #21 |
This creates
cached_divgcd
with a specialized method forInt8
which caches all results at compilation time. Can get a 4x speedup on vectorized computations with normal Rational{Int8}.This defines a
CRational
struct that uses thiscached_divgcd
for relevant rational calculations@oscardssmith