Coder Social home page Coder Social logo

Comments (4)

giordano avatar giordano commented on May 10, 2024 2

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 weightedmean functions which is much faster and probably what the user is after.

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.

Any chance that performance of Measurements.jl can be improved?

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!

from measurements.jl.

aplavin avatar aplavin commented on May 10, 2024

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.

from measurements.jl.

giordano avatar giordano commented on May 10, 2024

what is often needed is just simple uncertainty propagation with independent observations

It's not that simple. If x is a measurement, f(x) is a quantity correlated with x, then if you perform calculations involving both x and f(x) (or another quantity derived from x) you have to take care of correlation between them. Correlation is not important only if you're going to perform a single operation with a one-argument only function, and then stop

from measurements.jl.

giordano avatar giordano commented on May 10, 2024

However it would be useful to have another mode (or type, or something) for fast computations without tracking correlations.

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 Float64 numbers. Large overhead comes when several quantity are involved, performance of calculations involving Measurement objects currently goes as O(n^2). It would be really great if someone could find a way to improve performance to O(n).

from measurements.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.