A Simple & Effective Way To Improve Python Class Performance

Описание к видео A Simple & Effective Way To Improve Python Class Performance

There's a very simple way to improve Python performance of your code. And you know what's so nice about this performance improvement? It also nudges you to use good Python software design practices - it's a win-win!

The code I worked on in this episode is available here: https://github.com/ArjanCodes/2022-slots.

💡 Get my FREE 7-step guide to help you consistently design great software: https://arjancodes.com/designguide.

💻 ArjanCodes Blog: https://www.arjancodes.com/blog

🎓 Courses:
The Software Designer Mindset: https://www.arjancodes.com/mindset
The Software Designer Mindset Team Packages: https://www.arjancodes.com/sas
The Software Architect Mindset: Pre-register now! https://www.arjancodes.com/architect
Next Level Python: Become a Python Expert: https://www.arjancodes.com/next-level...
The 30-Day Design Challenge: https://www.arjancodes.com/30ddc

🛒 GEAR & RECOMMENDED BOOKS: https://kit.co/arjancodes.

🎓 Sign up to Brilliant now and get 20% off the annual subscription: https://brilliant.sjv.io/arjancodes.

👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!

💬 Discord: https://discord.arjan.codes
🐦Twitter:   / arjancodes  
🌍LinkedIn:   / arjancodes  
🕵Facebook:   / arjancodes  

👀 Code reviewers:
- Yoriz
- Ryan Laursen
- Sybren A. Stüvel
- Dale Hagglund

🎥 Video edited by Mark Bacskai:   / bacskaimark  

🔖 Chapters:
0:00 Intro
0:50 How classes work in Python
2:00 Descriptors
2:46 Basic class example with the dict dunder method
3:53 Using slots
5:02 Slots performance test
6:07 Using slots with dataclasses
7:19 Slots performance test #2 (with dataclasses)
8:00 Why are slots not used by default?
8:39 Slots limitation: mixins and multiple inheritance
10:23 Slots limitation: dynamic attributes
11:25 Final thoughts

#arjancodes #softwaredesign #python

DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!

Комментарии

Информация по комментариям в разработке