In this video we look at how to implement caching for functions, class properties and class methods to improve time performance.
We also look at some of the associated caveats, and where you need to be a bit more careful.
#mathbyteacademy #python
Content
=======
00:00 - Introduction
07:18 - Caching from First Principles
14:51 - Python's LRU Cache and the @lru_cache Decorator
19:08 - Python's @ache decorator
19:43 - Caveats and Finer Details of the LRU Cache
22:52 - Caching Class Properties
27:09 - Cached Properties and Mutability Caveats
35:49 - Caching Class Methods using the LRU Cache
42:41 - Conclusion and 3rd Party Library for more options
Code for this Video
===================
Available in GitHub blog repo: https://github.com/fbaptiste/python-blog
Direct link: https://tinyurl.com/yrnka7y4
My Python Courses
=================
- Python 3 Fundamentals (introduction to Python)
https://www.udemy.com/course/python3-fundamentals/?referralCode=DA09C6F40CEC38C942F6
- Python 3 Deep Dive (Part 1 - Functional)
https://www.udemy.com/course/python-3-deep-dive-part-1/?referralCode=E46B931C71EE01845062
- Python 3 Deep Dive (Part 2 - Iteration, Generators)
https://www.udemy.com/course/python-3-deep-dive-part-2/?referralCode=3E7AFEF5174F04E5C8D4
- Python 3 Deep Dive (Part 3 - Hash Maps)
https://www.udemy.com/course/python-3-deep-dive-part-3/?referralCode=C5B0D9AB965B9BF4C49F
- Python 3 Deep Dive (Part 4 - OOP)
https://www.udemy.com/course/python-3-deep-dive-part-4/?referralCode=3BB758BE4C04FB983E6F