Skip to content

Disparate performance in diff methods #541

Open
@arlk

Description

@arlk

First of all, thank you for this great package! I'm a relatively new Julia user and I was using Static Arrays for some polynomial math that needs to use diff. I noticed that the benchmark speeds are very different for the two diff methods. MWE:

julia> A = @SMatrix randn(3,20);

julia> @btime diff($A,dims=$2);
  3.299 μs (2 allocations: 1.06 KiB)

julia> @btime diff($A,dims=$(Val(2)));
  37.283 ns (0 allocations: 0 bytes)

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