-
Notifications
You must be signed in to change notification settings - Fork 37
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
Arithmetic operations very slow #25
Comments
Yes, I'm aware that for large calculations the performance is not ideal. Try computing the mean of a large vector 😣 However, for a large set of uncorrelated measurements there is the The extremely basic implementation from rosettacode is fast because it doesn't deal with correlation: julia> x1 = Measure(100, 1.1) # from rosettacode
100.0 ± 1.1
julia> x1-x1
0.0 ± 1.5556349186104046
julia> x = measurement(100, 1.1) # from this package
100.0 ± 1.1
julia> x-x
0.0 ± 0.0 Dealing with correlation is the main source of the overhead. I prefer something slow but correct to something fast but unreliable.
Not from me, currently, but patches are always welcome 🙂 The important thing is that functionalities are maintained, this should be an under-the-hood only change. I've the feeling that performance can be improved, but I've never looked into this very deeply. Thanks for opening this issue! |
I see, correlations indeed can be quite important and it is far from obvious how to speed up calculations while maintaining them. However it would be useful to have another mode (or type, or something) for fast computations without tracking correlations. For even moderately-sized datasets x50 slowdown is very significant, and what is often needed is just simple uncertainty propagation with independent observations. |
It's not that simple. If |
I see your point, and it shouldn't be too hard to implement what you ask, but in my opinion its utility would be very limited (see above message) and would greatly confuse users (which type should I use? With correlation or not? What if I later change my mind?). Some overhead compared to plain-bit numbers is to be expected, this type is going to do much more than adding or multiplying simple |
It looks like this package has a lot of overhead for simple math operations - about 50 times slower than normal floats and uses 20 times more memory! Not even talking about number of allocations.
For comparison, an extremely basic implementation from rosettacode has only 4x overhead, which is completely reasonable:
Any chance that performance of Measurements.jl can be improved?
The text was updated successfully, but these errors were encountered: