Last active
October 9, 2020 21:39
-
-
Save naufalafif/cca3e11e51b12f599727cd40f1588078 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
memoized_fake_heavy_computation = memoize(fake_heavy_computation) | |
memoized_fake_heavy_computation(3) # selesai dalam 2 s | |
memoized_fake_heavy_computation(3) # selesai dalam 4 ms | |
memoized_fake_heavy_computation(4) # selesai dalam 2 s | |
[memoized_fake_heavy_computation(3) for _ in range(10000)] # selesai dalam 600 ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment