paint-brush
Using Memoization In Python To Speed Up Slow Functionsby@emilsadek
1,006 reads
1,006 reads

Using Memoization In Python To Speed Up Slow Functions

by Emil Sadek2mMay 23rd, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Memoization is an optimization technique that speeds up programs by caching the results of previous function calls. This allows subsequent calls to reuse the cached results, avoiding time-consuming recalculation. The functools module included in Python's standard library provides two useful decorators for memoization. These decorators use a least recently used (LRU) cache, which stores items in order of use, discarding the least used items to make room for new items. Python 3 makes it incredibly easy to memorize functions.
featured image - Using Memoization In Python To Speed Up Slow Functions
Emil Sadek HackerNoon profile picture
Emil Sadek

Emil Sadek

@emilsadek

Software Engineer

About @emilsadek
LEARN MORE ABOUT @EMILSADEK'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Emil Sadek HackerNoon profile picture
Emil Sadek@emilsadek
Software Engineer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Learnrepo
Newsbreak
Scien