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

specialize on mapfoldl(::Type, ...) #39019

Merged
merged 1 commit into from
Dec 30, 2020
Merged

specialize on mapfoldl(::Type, ...) #39019

merged 1 commit into from
Dec 30, 2020

Conversation

simeonschaub
Copy link
Member

Before:

julia> using BenchmarkTools

julia> b = rand(Bool, 10000);

julia> @btime mapfoldl(Int, +, b; init=0)
  1.136 ms (9025 allocations: 141.02 KiB)
5057

After:

julia> @btime mapfoldl(Int, +, b; init=0)
  1.094 μs (1 allocation: 16 bytes)
5057

Before:
```julia
julia> using BenchmarkTools

julia> b = rand(Bool, 10000);

julia> @Btime mapfoldl(Int, +, b; init=0)
  1.136 ms (9025 allocations: 141.02 KiB)
5057
```

After:
```julia
julia> @Btime mapfoldl(Int, +, b; init=0)
  1.094 μs (1 allocation: 16 bytes)
5057
```
@simeonschaub simeonschaub added performance Must go faster domain:fold sum, maximum, reduce, foldl, etc. labels Dec 28, 2020
@simeonschaub simeonschaub merged commit 3d922e4 into master Dec 30, 2020
@simeonschaub simeonschaub deleted the sds/spec_mapfoldl branch December 30, 2020 19:00
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
Before:
```julia
julia> using BenchmarkTools

julia> b = rand(Bool, 10000);

julia> @Btime mapfoldl(Int, +, b; init=0)
  1.136 ms (9025 allocations: 141.02 KiB)
5057
```

After:
```julia
julia> @Btime mapfoldl(Int, +, b; init=0)
  1.094 μs (1 allocation: 16 bytes)
5057
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:fold sum, maximum, reduce, foldl, etc. performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants