Methods To Remember Things By: Ruby Memoization
No Rubyist wants to make expensive, time-consuming method calls more than they have to. Thankfully, using memoization means that we don’t have to (well, at least, not as often). This blog post covers the history behind memoization, its implementation, and its controversial history in the Rails source code.
Comments
One thing you forgot to talk about is memoizing results of methods that receive arguments. Gems like memoist allow that out of the box, while you have to use some cryptic hash techniques if you stick to normal instance variable memoizing.
Post a comment