Skip to content

Conversation

KnutAM
Copy link
Member

@KnutAM KnutAM commented Dec 23, 2024

Noticed that

curl(x -> rotate(x, angle::Real), rand(Vec{2}))

failed since rotate(::Vec{3}, angle::Real) is not defined.

The new implementation should be faster as well, se below.

@KnutAM
Copy link
Member Author

KnutAM commented Dec 23, 2024

Benchmarks,

julia> foo(x::Vec) = (x[1] * x[2]) * x
foo (generic function with 1 method)

julia> x = rand(Vec{2});

julia> @btime curl($foo, $x);
  1.916 ns (0 allocations: 0 bytes) # PR 
  3.542 ns (0 allocations: 0 bytes) # master

@KnutAM
Copy link
Member Author

KnutAM commented Jan 6, 2025

Ready for review, @fredrikekre or @KristofferC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant