Troubleshooting Python Application Development

Video description

Tackle Python performance problems and speed up your apps with parallelism, concurrent execution, and OOP

About This Video

  • Covers common Python application development problems documented online, leveraging sources such as Stack Overflow, Medium, and GitHub, and solves them entirely in one course.
  • Each video is constructed in a problem-solution format, making it easy to understand the problem and grasp the solution.
  • Tried and tested solutions to solve common problems, speeding up your Python code and reducing its memory footprint.

In Detail

Although you're comfortable with Python, you wonder whether you are writing fast and performant code. Once in a while, you run out of RAM or your application doesn't run fast enough, and this forces you to find a different solution.

To further your software development career, you need to understand why and how Python executes your code so that you can create clean code that compiles in time.

Troubleshooting Python Application Development is your answer. This course takes you through a structured journey of performance problems that your application is likely to encounter, and presents both the intuition and the solution to these issues. You'll get things done, without a lengthy detour into how Python is implemented or computational theory.

Quickly detect which lines of code are causing problems, and fix them quickly without going through 300 pages of unnecessary detail.

All the code and the supporting files of this course are available on GitHub at -

Table of contents

  1. Chapter 1 : Locating Root Causes by Benchmarking and Profiling Your Application
    1. The Course Overview 00:02:48
    2. Measuring Time Between Two Lines of Code with timeit 00:08:24
    3. Figuring out Where Time Is Spent with the Profile Module 00:09:49
    4. More Precise Time Tracking with cProfile 00:05:34
    5. Looking at Memory Consumption with memory_profiler 00:05:24
  2. Chapter 2 : Python Idioms for Faster Code
    1. Reduce Execution Time and Memory Consumption with __slots__ 00:05:54
    2. Use Tuples Instead of Lists When Your Data Does Not Change 00:05:20
    3. Save on Memory Consumption with Generators Instead of Lists 00:06:18
    4. When to Use Lists Instead of Generators 00:03:09
    5. Leveraging Itertools to Create Generator Pipelines 00:04:19
  3. Chapter 3 : Tackling Long Running Loops on Big Lists with NumPy
    1. The Problem with Using Lists to Perform Vector Calculations 00:06:24
    2. Using NumPy’s Arrays for More Powerful Vector Representations 00:05:19
    3. Rewriting Our Problem with NumPy to Speed It up 40x 00:04:27
    4. Fast MapReduce with NumPy Broadcasting 00:07:35
    5. Optimize All Calculations in One Go with numexpr 00:06:15
  4. Chapter 4 : Speed Up Your I/O Heavy Tasks with Concurrent Programming
    1. The Problem of Serially Executing Web Scraping Calls 00:08:57
    2. Simple Asynchronous Programming with coroutines and gevent 00:08:01
    3. Event-Driven Concurrency with Tornado 00:05:34
    4. Concurrency and Futures with asyncio 00:05:58
  5. Chapter 5 : Make Your Apps Run Faster with Parallel Programming
    1. Getting Started with Parallel Programming 00:06:59
    2. Doubling the Speed of Your List Processing with Tuples 00:04:22
    3. Easily Speed up a Group of Processes with Pool 00:05:18
    4. Stop Processes from Interfering with Each Other with Locks 00:06:28
    5. Logging What Happens When You Have Many Processes 00:05:11
  6. Chapter 6 : Organize Your Code Better Using Object-Oriented Programming
    1. Stop Modifying the Wrong Object Instance with Correct Object Cloning 00:07:24
    2. Speed Up Your OOP with namedtuples 00:04:43
    3. Reduce Getters and Setters with Static Methods and Properties 00:04:52
    4. Comparing Two Different Objects 00:04:15
    5. Improve Readability with Abstract Base Classes in Python 00:04:49

Product information

  • Title: Troubleshooting Python Application Development
  • Author(s): Rudy Lai
  • Release date: July 2018
  • Publisher(s): Packt Publishing
  • ISBN: 9781788995337