3 ms·
The ruby code [in the linked article] is complete rubbish. In addition, the Ruby implementation is memoized while the Python example isn't. Clearly that means t
by ioquatix 13y ago
The ruby code [in the linked article] is complete rubbish. In addition, the Ruby implementation is memoized while the Python example isn't. Clearly that means there is a significant performance difference. I'd like to see the memoized Python implementation in one line.
- doctoboggan 13y agoIt's just one more line - wrapping the function with the memoization decorator from the stdlib: http://docs.python.org/3/library/functools.html#functools.lru_cache http://docs.python.org/3/library/functools.html#functools.lr...
- panzi 13y agoAnd it's much clearer on what it actually does.