-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
im*Matrix is much slower than real scalar*Matrix #243
Comments
Does this have anything to do with global variables in the REPL or something? Since I am not creating a matrix and using it, It seems that the type inference on globals is not an issue here, especially since the real scalar*Matrix does work fast. |
Not that it changes this issue, but as a side note we should always use |
Adding this definition speeds it up by more than 2x:
So that much of the time is taken just by the extra operations in complex *. |
Ok, and all the rest of the time is taken by the integer manipulations in the complex constructor:
|
We are now down to 5x slower. julia> @time im*ones(2000,2000); |
Subsumed by #323. |
* Add Base.norm, normalize and normalize! for Histogram * Add Base.float for Histogram and support for aux_weights on normalize * Add tests for histogram norm and normalize * Clarify description of histogram hormalization modes * Add histogram normalization mode :none * Better exceptions and small coding style improvements in hist norm code Also removed some remnant code in hist norm tests. * Add proper docstrings for histogram norm, normalize and normalize! * Add tests for histogram normalize! and normalize with aux weights * Add new field isdensity to Histogram, refactor histogram code Enables consistent and idempotent behaviour of normalization, increases histogram filling performance. Changes: * New Histogram field isdensity * Support for isdensity in constructors, etc., includes refactoring of ctor code (removed duplicated code). * Refactoring of histogram fill code: * Removed duplicated code * New functions binindex and binvolume * Significant performance gain for push!/append! * Support for fit(Histogram{T}, ...) * Better structure of histograms tests with test sets * Remove _tuple_map from Histogram implementation Better to add this to Base. * Simplify implementation of _multi_getindex * Fix float(h::Histogram) * Handle h.isdensity * Don't copy more than necessary (as requested by A. Noack) * Change histogram norm to directly return integral value, not it's norm. * Extend == and show for Histogram to handle new isdensity field * Fix normalize! for Histogram Don't set h.isdensity to true for mode == :none * Improve numerical precision in implementation of Histogram norm/normalize * Use _edge_binvolume in implementation of Histogram norm/normlalize Also add optional result-type argument to binvolume * Change implementation of float(::Histogram), remove _float_deepcopy * Minor code pretty-up in push!(::Histogram)
Multiplying a matrix with im is 10x slower than multiplying it by a real number.
julia> @time im*ones(2000,2000);
elapsed time: 1.40052605 seconds
julia> @time 2*ones(2000,2000);
elapsed time: 0.13868904 seconds
The text was updated successfully, but these errors were encountered: