Thanks. I think it is very likely that your approach will be how
anonymous functions will work by default in the near future.

On Tue, Jan 7, 2014 at 9:16 AM, Mike Innes <[email protected]> wrote:
> Anonymous functions in Julia currently have a lot of overhead. However, I've
> come up with a temporary solution to this by writing a little macro which
> speeds up anonymous function calls - all you have to do is wrap your
> functions in @fn and they'll speed up, e.g.
>
> x -> x^2
>
> becomes
>
> @fn x -> x^2
>
> or
>
> @fn function(x)
>   x^2
> end
>
> A quick benchmark shows that calling this wrapped function is about 15x
> faster. The macro defined at line 74 of this gist, along with some other
> useful utils:
>
> https://gist.github.com/one-more-minute/8299575
>
> Enjoy!

Reply via email to