Skip to content

in-place broadcast (e.g. .+=) significanctly slower for reinterpreted array #48801

Open
@Moelf

Description

@Moelf

on 1.9-beta4 and master branch (0b8e8fc):

julia> using BenchmarkTools

julia> @btime ary.+=Int32(1) setup = (ary = rand(Int32, 10^5));
  3.389 μs (0 allocations: 0 bytes)

julia> @btime ary.+=Int32(1) setup = (ary = reinterpret(Int32, rand(UInt8, 10^5*4)));
  31.680 μs (0 allocations: 0 bytes)

not sure if it's just another facet of:

Metadata

Metadata

Assignees

No one assigned

    Labels

    broadcastApplying a function over a collectionperformanceMust go faster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions