Skip to content

rand allocations #94

Description

@kalmarek

as observed in #82:

julia> @btime ArbMatrix(rand(Arb(prec=256), 100,100));
  4.085 ms (50007 allocations: 3.21 MiB)

julia> @btime ArbMatrix(rand(Arb, 100,100));
  4.507 ms (60005 allocations: 4.27 MiB)

i.e. 6 allocations per entry despite

julia> @btime Arb(rand($BigFloat));
  271.410 ns (5 allocations: 336 bytes)

Also:

julia> @btime ArbMatrix(rand($BigFloat, 100, 100));
  2.647 ms (30006 allocations: 2.06 MiB)

julia> @btime ArbMatrix(Arb.(rand($BigFloat, 100, 100)));
  3.293 ms (50008 allocations: 3.28 MiB)

julia> @btime ArbMatrix(rand($Arb, 100, 100));
  4.521 ms (60005 allocations: 4.27 MiB)

i.e. I botched random API :P

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions