Skip to content

MArray is slower than Array in reduction #540

Closed
@YingboMa

Description

@YingboMa

MWE:

julia> using BenchmarkTools

julia> a = @MArray rand(4);

julia> @btime sum( $(Array(a)) )
  3.896 ns (0 allocations: 0 bytes)
1.5713808992800153

julia> @btime sum( $a )
  30.021 ns (1 allocation: 16 bytes)
1.5713808992800153

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions