High Performance Python is the simplified Chinese edition of the bestselling O'Reilly book of the same name, introduced and published by Posts & Telecom Press. The book has 12 chapters. Its subject is not Python syntax itself but a core question: when a program is not fast enough, how can you find the real bottleneck and make it faster with the right methods? The book begins with background knowledge on the computer's internal structure to help readers understand what costs Python's interpreted execution, object model, and memory allocation actually incur at a low level, so they understand "why it is slow." It then discusses the time and space overhead of basic data structures such as lists and tuples, dictionaries and sets; the lazy evaluation approach of iterators and generators; and NumPy-based matrix and vector computation—achieving order-of-magnitude speedups by pushing loops down to the C layer. At the tool level, the book explains how to use profilers to locate hotspots in CPU and memory consumption, how to benchmark and visualize, and how to avoid optimizing by feel; it also explains paths such as Cython and PyPy that compile Python code to machine code or use just-in-time compilation. In the concurrency and parallelism section, the book distinguishes the scenarios suited to multithreading, multiprocessing, and asynchronous I/O, explains the impact of the GIL on CPU-bound tasks, and shows how to turn multiprocessing code into a task system that can run on local or remote clusters and work queues. The final chapter uses several real cases to show the complete process of locating and solving performance problems in practical applications such as social media analysis and machine learning. The book is aimed at beginner-to-intermediate developers who already know Python and want to write efficient code.
Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.
示例主要用于演示测量与优化思路,可直接运行验证,但版本与工具生态在变化,落地时应结合当前官方文档核对 API 与最佳实践。
Comments
Find this book
This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.