2022-04-30 00:46:58 +02:00
..

Chapter 12 - performance
=======================================================================================================================

1. Try to create a decorator that monitors each run of a function and warns you if the memory usage grows each run.
2. Try to create a decorator that monitors the runtime of a function and warns you if it deviates too much from the previous run. Optionally, you could make the function generate a (running) average runtime as well.
3. Try to create a memory manager for your classes that warns you when more than a configured number of instances remain in memory. If you never expect more than 5 instances of a certain class, you can warn the user when that number is exceeded.