dummy-link

Memoize

@memoize macro for Julia

Readme

Memoize.jl

Build Status Coverage Status

Easy memoization for Julia.

Usage

using Memoize
@memoize function x(a)
    println("Running")
    a
end
julia> x(1)
Running
1

julia> x(1)
1

By default, Memoize.jl uses an ObjectIdDict as a cache, but it's also possible to specify the type of the cache. If you want to cache vectors based on the values they contain, you probably want this:

using Memoize
@memoize Dict function x(a)
    println("Running")
    a
end

Implementation notes

  • Type inference will not work for memoized functions. If performance is critical, consider annotating the type of the output of the memoized function.html julia-observer-html-cut-paste-1__work

First Commit

05/16/2013

Last Touched

13 days ago

Commits

31 commits

Requires:

Used By: