Python High Performance Programming
暫譯: Python 高效能程式設計

Gabriele Lanaro

  • 出版商: Packt Publishing
  • 出版日期: 2013-12-22
  • 售價: $1,350
  • 貴賓價: 9.5$1,283
  • 語言: 英文
  • 頁數: 108
  • 裝訂: Paperback
  • ISBN: 1783288450
  • ISBN-13: 9781783288458
  • 相關分類: Python程式語言
  • 已過版

相關主題

商品描述

If you have at least a basic knowledge of Python, this book will help you maximize the performance of your code and applications. Easy to follow tutorials will make you a hard act to follow in Python programming.

Overview

  • Identify the bottlenecks in your applications and solve them using the best profiling techniques
  • Write efficient numerical code in NumPy and Cython
  • Adapt your programs to run on multiple processors with parallel programming

In Detail

Python is a programming language with a vibrant community known for its simplicity, code readability, and expressiveness. The massive selection of third party libraries make it suitable for a wide range of applications. This also allows programmers to express concepts in fewer lines of code than would be possible in similar languages. The availability of high quality numerically-focused tools has made Python an excellent choice for high performance computing. The speed of applications comes down to how well the code is written. Poorly written code means poorly performing applications, which means unsatisfied customers.

This book is an example-oriented guide to the techniques used to dramatically improve the performance of your Python programs. It will teach optimization techniques by using pure python tricks, high performance libraries, and the python-C integration. The book will also include a section on how to write and run parallel code.

This book will teach you how to take any program and make it run much faster. You will learn state-of the art techniques by applying them to practical examples. This book will also guide you through different profiling tools which will help you identify performance issues in your program. You will learn how to speed up your numerical code using NumPy and Cython. The book will also introduce you to parallel programming so you can take advantage of modern multi-core processors.

This is the perfect guide to help you achieve the best possible performance in your Python applications.

What you will learn from this book

  • Assess the performance of your programs using benchmarks
  • Spot the bottlenecks in your code using the Python profiling tools
  • Speed up your code by replacing Python loops with NumPy
  • Boost NumPy performance using the numexpr compiler
  • Use Cython to reach performance on par with the C language
  • Write code for multiple processors
  • Profile, optimize, and rewrite an application from start to finish

Approach

An exciting, easy-to-follow guide illustrating the techniques to boost the performance of Python code, and their applications with plenty of hands-on examples.

Who this book is written for

If you are a programmer who likes the power and simplicity of Python and would like to use this language for performance-critical applications, this book is ideal for you. All that is required is a basic knowledge of the Python programming language. The book will cover basic and advanced topics so will be great for you whether you are a new or a seasoned Python developer.

商品描述(中文翻譯)

如果您對 Python 至少有基本的了解,本書將幫助您最大化代碼和應用程序的性能。易於跟隨的教程將使您在 Python 編程中成為一個難以超越的高手。

概述
- 確定應用程序中的瓶頸,並使用最佳的性能分析技術解決它們
- 在 NumPy 和 Cython 中編寫高效的數值代碼
- 通過並行編程使您的程序適應多處理器運行

詳細內容
Python 是一種具有活躍社群的編程語言,以其簡單性、代碼可讀性和表達能力而聞名。大量的第三方庫使其適用於各種應用程序。這也使得程序員能夠用比類似語言更少的代碼行來表達概念。高品質的數值工具的可用性使 Python 成為高性能計算的絕佳選擇。應用程序的速度取決於代碼的編寫質量。編寫不良的代碼意味著性能不佳的應用程序,這會導致客戶不滿意。

本書是一本以範例為導向的指南,介紹用於顯著提高 Python 程序性能的技術。它將通過使用純 Python 技巧、高性能庫和 Python-C 整合來教授優化技術。本書還將包括一個關於如何編寫和運行並行代碼的部分。

本書將教您如何使任何程序運行得更快。您將通過將最先進的技術應用於實際範例來學習這些技術。本書還將指導您使用不同的性能分析工具,幫助您識別程序中的性能問題。您將學習如何使用 NumPy 和 Cython 加速數值代碼。本書還將介紹並行編程,以便您能夠利用現代多核處理器的優勢。

這是一本完美的指南,幫助您在 Python 應用程序中實現最佳性能。

您將從本書中學到的內容
- 使用基準測試評估程序的性能
- 使用 Python 性能分析工具找出代碼中的瓶頸
- 通過用 NumPy 替換 Python 循環來加速代碼
- 使用 numexpr 編譯器提升 NumPy 性能
- 使用 Cython 達到與 C 語言相當的性能
- 為多處理器編寫代碼
- 從頭到尾分析、優化和重寫應用程序

方法
一本令人興奮且易於跟隨的指南,說明了提升 Python 代碼性能的技術及其應用,並提供了大量的實作範例。

本書的讀者對象
如果您是一位喜歡 Python 的強大和簡單性的程序員,並希望將此語言用於性能關鍵的應用程序,那麼本書非常適合您。所需的僅僅是對 Python 編程語言的基本了解。本書將涵蓋基本和進階主題,因此無論您是新手還是資深的 Python 開發者,都會對您大有幫助。