The Real Python Podcast

Comparing Real-World Python Performance Against Big O

36 snips
Jul 11, 2025
Christopher Trudeau, a contributor to PyCoder's Weekly, dives deep into the real-world performance of algorithms versus Big O expectations. He discusses how Python can compete with compiled languages like Go through practical profiling. Listeners learn about fascinating topics such as detecting vowels in strings, the ordered nature of Python dictionaries, and the significance of using enums for better code organization. Trudeau also highlights innovative community projects and recent developments in the Python ecosystem, showcasing the ever-evolving landscape of programming.
Ask episode
AI Snips
Chapters
Books
Transcript
Episode notes
INSIGHT

Python Dicts Preserve Insertion Order

  • Python dictionaries maintain insertion order since Python 3.7 as a language feature.
  • However, dictionaries are not sequences and equality ignores order of keys, unlike lists.
INSIGHT

Fastest Vowel Detection Uses Built-ins

  • The fastest way to detect vowels uses Python's built-in "in" operator due to C-level optimizations.
  • Recursive and regex methods can fail or degrade significantly with longer strings.
ADVICE

Avoid Enum Auto for Databases

  • Avoid using enum's auto numbering if you store values externally, to maintain backward compatibility.
  • Manually assign enum values to prevent issues from inserts or reorderings.
Get the Snipd Podcast app to discover more snips from this episode
Get the app