-
Notifications
You must be signed in to change notification settings - Fork 11
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
Use better sin_sum for F32 #93
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #93 +/- ##
==========================================
+ Coverage 96.09% 96.49% +0.40%
==========================================
Files 20 20
Lines 2228 2228
==========================================
+ Hits 2141 2150 +9
+ Misses 87 78 -9
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
is it also slower in the range where the old one was accurate? |
Yep it is definitely slower. But I think it's a hard comparison because the old version I'm not for sure we could say was "accurate" in any range.
Some larger comparisons on accuracy...
But ya it is a performance degradation. # old
julia> @benchmark besselj0(x) setup=(x=Float32(rand() + 2.0))
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
Range (min … max): 9.000 ns … 25.500 ns ┊ GC (min … max): 0.00% … 0.00%
Time (median): 9.083 ns ┊ GC (median): 0.00%
Time (mean ± σ): 9.090 ns ± 0.252 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
█
▂▁▁▁▁▁▁▁▁▁▁▅▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▁▁▂▁▁▁▁▁▁▁▁▁▁▂ ▂
9 ns Histogram: frequency by time 9.21 ns <
Memory estimate: 0 bytes, allocs estimate: 0.
# new
julia> @benchmark besselj0(x) setup=(x=Float32(rand() + 2.0))
BenchmarkTools.Trial: 10000 samples with 998 evaluations.
Range (min … max): 15.364 ns … 37.074 ns ┊ GC (min … max): 0.00% … 0.00%
Time (median): 15.489 ns ┊ GC (median): 0.00%
Time (mean ± σ): 15.500 ns ± 0.417 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
▃ █
▂▁▁▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▆▁▁▁▁▁▁▁▁▂▃▁▁▁▁▁▁▁▁▂ ▂
15.4 ns Histogram: frequency by time 15.6 ns <
Memory estimate: 0 bytes, allocs estimate: 0. |
Side note: It would be really nice to have some CI setup for benchmarking all these functions. Maybe not have it run on every pull request but more on command using either PkgBenchmark.jl or the recent https://github.com/MilesCranmer/AirspeedVelocity.jl which looked interesting. |
@oscardssmith How do we feel about merging this? I think I would prefer the accuracy improvements in this and can improve performance over time if needed. Needs a rebase. |
should this be merged or is it outdated? |
This fixes #90 where performance was fixed in #92.
This significantly improves accuracy. The naive version of course is faster..
So about 20% slower but performance hit is necessary here as the previous result is inaccurate.