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