[ANN] Memoization.jl

marius311
Wed, 27 Nov 2019 02:49:01 +0000
Package Announcements

I created Memoization.jl to address some of the limitations of Memoize.jl. It’s API compatible with Memoize.jl (just @memoize your function definitions):

julia> using Memoization

julia> @memoize f(x) = (println("Computed $x"); x)

julia> f(2)
Computed 2
2

julia> f(2)
2

As of this writing, Memoization.jl has the following advantages:

It allows more function definition forms, including with keyword arguments and type parameters.

It does not issue any warnings, and allows you to memoize different methods of the same function across different modules.

Closures work, meaning different instances of closures with different closed-over variables can be separately and simultaneously memoized.

You can empty memoization caches.

Lookup is a bit faster

Feel free to take it for a spin and let me know if you run into any issues!

13 posts - 9 participants