Closing out the day at #PyConUS2022 is @anthonypjshaw talking about improving the performance of your Python code.
The code demonstrating the gains mentioned in the talk is hosted at: GitHub.com/tonybaloney/an…
List comprehensions. Not just just more readable but also faster!
Consider, are you using the right data structure for the job?
Bold move: using the Comic Sans Mono font for code slides.
Performance of various data structures in different versions of Python is surprising. Watch the talk to learn more about why.
Be DRY, but small utility functions can have a surprising amount of overhead.
In this case, b() is 56% faster.
Don’t blindly apply these principals. Profile first. Avoid performance regressions.
Thanks for a great talk Anthony!
And for the folks following the thread don’t forget to check out the perf lint tool that Anthony’s created.
github.com/tonybaloney/pe…
Share this Scrolly Tale with your friends.
A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.