The S in Python stands for Speed

Shuvam Manna (~shuvam)


Description:

In January 2020 I joined a Start-up as the Fourth Engineer on the team. I used to think that I was probably half-decent in building full-stack systems, a little more proficient with Node over Python (and thereby taking the V8 speed for granted). The team had set up the entire project with Django, I thought that alright - I got this, how bad can it be?
Turned out, the views.py file was 57k+ LoC. Took a double-take. But my task was primarily to integrate micro-apps for Consumers into the system and then measure their impact and usage. The task required speed. Flushing out features, mini-games, and quizzes fast and then poring over the analytics. The Build Time was 5.6 minutes. For every single update, every single feature release needed us to take a coffee break, and there was only so much caffeine you can take.

To address this, we put our heads down to shave time off the build process. And this talk is going to be about some of our key understandings and takeaways during the process and addressing some fundamental questions around optimizations, the use of Compilers, JIT vs AOT, and some important trade-offs that can only be addressed on a case by case basis.
As a result, at the end of the Optimization sprint, we shaved around one minute off our Build time. Does not sound like much. But translated to shorter coffee breaks. Bummer!

Basic Outline

  • Why is Python slow? [3 Min]
  • Comparative study of execution speeds for Node, C, Python with the N-Body Algorithm [2 Min]
  • How is python executed? [1 Min]
  • Understanding what goes on under the hood for AOT and JIT Compilers [1 Min]
  • Memory allocation and the Global Interpreter Lock [8 Min]
  • Levels of Optimization (Design, Data Structure & Algorithms, Source Code, Compile Level, Runtime Level) [3 Min]
  • Implementation Patterns for Performance gain [10 Min]
  • Wrap up [1 Min]
  • QnA [5 Min]

Prerequisites:

  • Basic Knowledge of Python
  • Knowing the Pain of slow execution of Python

Video URL:

https://www.youtube.com/watch?v=hcSe8z8DyYg

Speaker Info:

Hi there! My name is Shuvam and I'm a Designer → Generalist, from India. I'm a Product Designer and Indie-Hacker, working on Projects such as Artemis and TabTrum.
I enjoy clicking Pictures, writing Blogs, giving talks, and playing music in my free time. I am a keen follower and a huge fan of Product Design and Optimization, in the latter, I have dabbled much with optimizing builds for full-stack web apps as well as website load performance in general.
Currently, I'm supercharging design at Winuall. I have led community-building initiatives at DSC HIT and GDG Kolkata. I am an Auth0 Ambassador and an active contributor at TFUG Kolkata. I was a part of the Social media and Org team for DroidCon India 2019 and am an avid detractor of Pineapple on Pizzas.

Section: Core Python
Type: Talks
Target Audience: Intermediate
Last Updated: