Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Python Performance Hacks - Part 1: Make Your Code Run Faster

Python Performance Hacks - Part 1: Make Your Code Run Faster

Master the craft of making Python code run faster comparable to code written in C/C++ and Rust programming languages
Last updated 12/2024
English

What you'll learn

  • Compare performance of a simple compute intensive program in Python, C, Java, Rust and Go
  • Learn how to make your python code faster comparable to similar code written in C and Rust
  • Learn the tips and techniques to improve performance of Python code
  • Learn how to use PyPy, Pythran, Cython and Numba to improve performance of Python code
  • Learn about the limitations and best practices for using PyPy, Pythran, Cython and Numba
  • Learn how to improve performance of Threads in Python

Course content

3 sections12 lectures5h 30m total length
  • Implementing a prime number generator in Python20:15

    In this lecture, you’ll see first-hand - the default computational performance of Python using the official runtime and standard built-in data types. I will demonstrate this by implementing a simple prime number generator in Python and running it on a streamlined Linux setup ( Raspberry Pi OS based on Debian GNU/Linux 12 ) on a Raspberry Pi 4 Model B with 8 GB of RAM. This minimalist setup is chosen to make the performance results easily reproducible, offering you an accurate understanding of Python’s baseline speed in handling computational tasks.

  • Implementing a prime number generator in Java17:22

    In this lecture, you will learn how to implement a prime number generator in Java programming language using the modern Java syntax. You will learn the syntax differences and the features of the Java programming language in comparison to Python. You will also notice the performance of a Java program in comparison to Python program while implementing similar computational algorithm. You will also gain high-level insights on design and programming idioms inherent in Java.

  • Implementing a prime number generator in C and C++21:54

    In this lecture, you will learn how to implement a prime number generator in the C and C++ programming languages. You will also learn about the computational performance of programs written in C and C++ in comparison to similar code written in Java and Python. You will also gain high-level insights on design and programming idioms of code written in C and C++ covering the features and limitations.

  • Implementing a prime number generator in Rust16:20

    In this lecture, you will learn how to implement a prime number generator using the Rust programming language. You will also learn about the computational performance of programs written in Rust in comparison to C/C++/Java/Python. You will also gain high-level insights on what makes Rust programming language popular in 2024 - its features, similarities and differences in comparison to Python

  • Implementing a prime number generator in Go11:10

    In this lecture, you will learn how to implement the code for generating prime numbers in the Go programming language. You will learn about the high-level syntax differences and similarities of Go language in comparison to Python, Java, C, C++ and Rust. You will also again high-level insights of features of Go programming language that has made it attractive for developers. You will also notice the computational performance of a program written using Go in comparison to similar code written in Python, C, C++, Java and Rust.

  • Comparing prime number generators written using Python, Java, C, Rust and Go19:26

    In this lecture, we will summarize the concepts learnt so far in the earlier lectures - comparing the computational performance of code written in Python, Java, C, C++, Rust and Go programming languages. You will gain insights on choosing the right programming language for a given task while knowing the benefits and limitations of each programming language that we have discussed earlier. You will also learn why programs written in Python are slow out-of-the-box in comparison to other programming languages that we chose.

Requirements

  • Basic Knowledge of Python Programming

Description

There's a famous quote that says "If you want to code faster, use Python; but if you want your code to run faster - just use C"!

In this course - Python Performance Hacks - Part 1: Make Your Code Run Faster,  I will teach how to make your python code run as fast as those written in C/C++/Rust. You will learn practical, hands-on techniques to enhance the speed and efficiency of your Python applications. This course is designed for Python developers who want to maximize performance without sacrificing code readability or maintainability. Whether you’re developing web applications, data analysis scripts, or backend processes, you'll find the skills to optimize your code for high performance without sacrificing the great features, benefits and the essence of Python programming language.

In this course, we’ll dive into the essential strategies for improving Python performance, covering tools and alternative language runtimes that perform Just-In-Time compilation, Ahead-Of-Time optimization and much more. You will learn how to make your python code run fast comparable to code written in C/C++/Rust. You will also learn about the best practices and use-case scenarios for these tools in your python code. You will also learn tricks to parallelize threads (circumventing the limitations of Global-Interpreter-Lock or GIL).

By the end of this course, you'll have a toolkit of performance-enhancing techniques to take your Python skills to the next level. Say goodbye to slow-running programs and hello to code that’s lean, powerful, and optimized for speed. Enroll to this course to transform your Python skills and make your code run faster than ever!



Who this course is for:

  • Beginner Python developers who want to improve performance of their Python code