Skip to main content
EuroPythonCode of ConductLive šŸ“¹

Writing Faster Python 3

Room:
The Auditorium
Start (Dublin time):
Start (your time):
Duration:
45 minutes

Abstract

Did you know that Python preallocates integers from -5 to 257? Reusing them 1000 times, instead of allocating memory for a bigger integer, can save you a couple milliseconds of codeā€™s execution time. If you want to learn more about this kind of optimizations then, ā€¦ well, probably this presentation is not for you :) Instead of going into such small details, I will talk about more ā€œsaneā€ ideas for writing faster code.

After a brief overview of different levels of optimization and how they work in Python, I will show you simple and fast ways of measuring the execution time of your code and finally, discuss examples of how some code structures could be improved.

You will see:

  • The fastest way of removing duplicates from a list
  • How much faster your code is when you reuse the built-in functions instead of trying to reinvent the wheel
  • What is faster than the ā€œfor loopā€
  • If the lookup is faster in a list or a set
  • When itā€™s better to beg for forgiveness than to ask for permission

TalkSoftware Engineering & Architecture


The speaker

Sebastian Witowski

Sebastian is a Python consultant and online course creator based in Poland. He started his journey with programming as a software developer at CERN, where he fell in love with Python (and teaching). Now he is helping companies untangle their complicated architecture and build all sorts of interesting Python projects.

In his spare time, he talks about Python, best practices in programming, and productivity.



ā† Back to schedule