Top "Memoization" questions

In computing, memoization is an optimization technique used primarily to speed up computer programs by having function calls avoid repeating the calculation of results for previously-processed inputs.

How do I cache a method with Ruby/Rails?

I have an expensive (time-consuming) external request to another web service I need to make, and I'd like to cache …

ruby-on-rails ruby caching idioms memoization
Which Ruby memoize pattern does ActiveSupport::Memoizable refer to?

So in Rails 3.2, ActiveSupport::Memoizable has been deprecated. The message reads: DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be …

ruby ruby-on-rails-3 activesupport memoization
Options for caching / memoization / hashing in R

I am trying to find a simple way to use something like Perl's hash functions in R (essentially caching), as …

r caching hash memoization memoise
When is memoization automatic in GHC Haskell?

I can't figure out why m1 is apparently memoized while m2 is not in the following: m1 = ((filter odd [1..]) !!) m2 …

haskell ghc memoization
What type to use to store an in-memory mutable data table in Scala?

Each time a function is called, if it's result for a given set of argument values is not yet memoized …

scala data-structures memoization scala-collections
How can I memoize a class instantiation in Python?

Ok, here is the real world scenario: I'm writing an application, and I have a class that represents a certain …

python caching singleton unique memoization
Store the cache to a file functools.lru_cache in Python >= 3.2

I'm using @functools.lru_cache in Python 3.3. I would like to save the cache to a file, in order to …

python python-3.x memoization
How is this fibonacci-function memoized?

By what mechanism is this fibonacci-function memoized? fib = (map fib' [0..] !!) where fib' 1 = 1 fib' 2 = 1 fib' n = fib (n-2) + fib (n-1) And …

haskell lazy-evaluation fibonacci memoization pointfree
C# Memoization of functions with arbitrary number of arguments

I'm trying to create a memoization interface for functions with arbitrary number of arguments, but I'm failing miserably I feel …

c# performance function memoization
How do I write a generic memoize function?

I'm writing a function to find triangle numbers and the natural way to write it is recursively: function triangle (x) …

optimization recursion lua closures memoization