Skip to content
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

map recommendations in deprecation warnings and NEWS harmful? #10537

Closed
garborg opened this issue Mar 17, 2015 · 3 comments
Closed

map recommendations in deprecation warnings and NEWS harmful? #10537

garborg opened this issue Mar 17, 2015 · 3 comments

Comments

@garborg
Copy link
Contributor

garborg commented Mar 17, 2015

For the deprecated lowercase int, bool, etc.

Timings (where vector is sized so map takes ~1 second):
Int -> Bool: map 20x slower than Vector{Bool} which is 25% slower than round
Bool -> Int: map 20x slower than Vector{Int} or round
Int8 -> Int: map 15x slower than Vector{Int} or round
Int -> Float: map 10x slower than Vector{Float64} or float
Float64 -> Float32: map 50x slower than Vector{Float32}

(Aside: I'm also unsure why Bool(200) works when Int8(200) doesn't, if anyone wants to point me to the right discussion.)

@simonster
Copy link
Member

Looks like there is a regression that may explain part (but not all) of the speed gap. On 0.3.6:

julia> immutable A; x::Int; end

julia> x = rand(Int, 100000000);

julia> @time map(A, x);
elapsed time: 0.8371671 seconds (800000128 bytes allocated)

On master:

julia> immutable A; x::Int; end

julia> x = rand(Int, 100000000);

julia> @time map(A, x);
elapsed time: 4.653523433 seconds (3814 MB allocated, 5.85% gc time in 140 pauses with 1 full sweep)

It doesn't look like map_to! has changed, so this may be a codegen regression.

@JeffBezanson
Copy link
Sponsor Member

Oh drat. This used to work, but removing the type from the first argument to map and map_to! causes us not to specialize it for every type. This is one of those heuristics.

@timholy
Copy link
Sponsor Member

timholy commented Mar 17, 2015

Thanks for catching and plugging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants