We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, the following caught me by surprise... Is there any good reason that the "true" sum function is so much more expensive?
julia> using Measurements [ Info: Precompiling Measurements [eff96d63-e80a-5855-80a2-b1b0885c5ab7] julia> x = rand(1000) .± rand(1000); julia> z = complex.(x,x); julia> @time sum(x) 0.124190 seconds (351.04 k allocations: 18.032 MiB) 496.0 ± 18.0 julia> @time sum(z) 2.022132 seconds (1.20 M allocations: 56.428 MiB, 1.64% gc time) (496.0 ± 18.0) + (496.0 ± 18.0)im julia> Base.sum(z::Array{Complex{Measurement{T}}}) where T= sum(real.(z)) .+ im*sum(imag.(z)) julia> @time sum(z) 0.126569 seconds (321.87 k allocations: 16.926 MiB) (496.0 ± 18.0) + (496.0 ± 18.0)im
The text was updated successfully, but these errors were encountered:
Yes, this is a duplicate of #25. In particular see #25 (comment)
Sorry, something went wrong.
No branches or pull requests
Hi,
the following caught me by surprise...
Is there any good reason that the "true" sum function is so much more expensive?
The text was updated successfully, but these errors were encountered: