Broken __slots__ are a silent performance killer—Let's fix them!
- Track:
- Testing, Quality Assurance, Security
- Type:
- Talk
- Level:
- advanced
- Room:
- South Hall 2A
- Start:
- 14:35 on Friday, 18 July 2025
- End:
- 15:05 on Friday, 18 July 2025
- Duration:
- 30 minutes
Abstract
__slots__
are a double-edged sword. While they promise a leaner memory footprint and faster attribute access, they can silently backfire, creating performance pitfalls in your code. Are you sure you're getting the benefits you think you are?
This talk clears up common misconceptions with up-to-date benchmarks, showing you what to really expect from __slots__
on modern Python. We’ll then dissect real-world failure modes—from overlapping definitions to broken inheritance—that can undermine your application's performance. You’ll learn to diagnose these issues and see how to automate their detection in your CI/CD pipeline, ensuring your __slots__
are a help, not a hindrance.