这本高性能Python(影印版) [High Performance Pvthon]图书,是2015-02-01月由东南大学出版社所出版的,著作者信息: Micha Gorelick,Lan Ozsvald 著,本版是第1次印刷, ISBN:9787564153854,品牌:南京东南大学出版社, 这本书的包装是16开平装,所用纸张为胶版纸,全书页数351,字数有45万5000字, 是本值得推荐的Python软件开发图书。
此书内容摘要
你的Python代码也许运行正确,但是你需要运行得更快速。通过探讨隐藏在设计备选方案中的基础理论,《高性能Python(影印版)》将帮助你更深入地理解Python的实现。你将了解如何定位性能瓶颈,从而显著提升高数据流量程序中的代码执行效率。
你该如何利用多核架构和集群?或者你该如何搭建一个可以自由伸缩而不会影响可靠性的系统?有经验的Python程序员将会学习到这类问题的具体解决方案,以及来自于各个公司的如何把高性能Python用于社交媒体分析、产品机器学习和其他场景中去的曲折故事。
关于此书作者
暂无.
编辑们的推荐
暂无.
高性能Python(影印版) [High Performance Pvthon]图书的目录
Preface
1. Understanding Performant Python
The Fundamental Computer System
Computing Units
Memory Units
Communications Layers
Putting the Fundamental Elements Together
Idealized Computing Versus the Python Virtual Machine
So Why Use Python?
2. Profiling to Find Bottlenecks
Profiling Efficiently
Introducing the Julia Set
Calculating the Full Julia Set
Simple Approaches to Timing——print and a Decorator
Simple Timing Using the Unix time Command
3. Lists and Tuples
A More Efficient Search
Lists Versus Tuples
Lists as Dynamic Arrays
Tuples As Static Arrays
Wrap-Up
4. Dictionaries and Sets
How Do Dictionaries and Sets Work?
Inserting and Retrieving
Deletion
Resizing
Hash Functions and Entropy
Dictionaries and Namespaces
Wrap-Up
5. Iterators and Generators
Iterators for Infinite Series
Lazy Generator Evaluation
Wrap-Up
6. Matrix and Vector Computation
Introduction to the Problem
Aren’t Python Lists Good Enough?
Problems with Allocating Too Much
Memory Fragmentation
Understanding perf
Making Decisions with perf’s Output
Enter numpy
Applying numpy to the Diffusion Problem
Memory Allocations and In-Place Operations
Selective Optimizations: Finding What Needs to Be Fixed
numexpr: Making In-Place Operations Faster and Easier
A Cautionary Tale: Verify “Optimizations” (scipy)
Wrap-Up
7. Compiling to C
What Sort of Speed Gains Are Possible?
JIT Versus AOT Compilers
Why Does Type Information Help the Code Run Faster?
Using a C Compiler
Reviewing the Julia Set Example
Cvthon
Compiling a Pure-Python Version Using Cython
Cython Annotations to Analyze a Block of Code
Adding Some Type Annotations
Shed Skin
Building an Extension Module
The Cost of the Memory Copies
Cython and numpy
ParaUelizing the Solution with OpenMP on One Machine
Numba
Pythran
PyPy
Garbage Collection Differences
Running PyPy and Installing Modules
When to Use Each Technology
Other Upcoming Projects
A Note on Graphics Processing Units (GPUs)
A Wish for a Future Compiler Project
Foreign Function Interfaces
ctypes
cffi
f2py
CPython Module
Wrap-Up
8. Concurrency
Introduction to Asynchronous Programming
Serial Crawler
gevent
tornado
AsyncIO
Database Example
Wrap-Up
9. lhe multiprocessing Module
An Overview of the Multiprocessing Module
Estimating Pi Using the Monte Carlo Method
Estimating Pi Using Processes and Threads
Using Python Objects
Random Numbers in Parallel Systems
Using numpy
Finding Prime Numbers
Queues of Work
Verifying Primes Using Interprocess Communication
Serial Solution
Naive Pool Solution
A Less Naive Pool Solution
Using Manager.Value as a Flag
Using Redis as a Flag
Using RawValue as a Flag
Using mmap as a Flag
Using mmap as a Flag Redux
Sharing numpy Data with multiprocessing
Synchronizing File and Variable Access
File Locking
Locking a Value
Wrap-Up
10. Clusters and Job Queues
Benefits of Clustering
Drawbacks of Clustering
$462 Million Wall Street Loss Through Poor Cluster Upgrade Strategy
Skype’s 24-Hour Global Outage
Common Cluster Designs
How to Start a Clustered Solution
Ways to Avoid Pain When Using Clusters
Three Clustering Solutions
Using the Parallel Python Module for Simple Local Clusters
Using IPython Parallel to Support Research
NSQ for Robust Production Clustering
Queues
Pub/sub
Distributed Prime Calculation
Other Clustering Tools to Look At
Wrap-Up
11. Using Less RAM
Objects for Primitives Are Expensive
The Array Module Stores Many Primitive Objects Cheaply
Understanding the RAM Used in a Collection
Bytes Versus Unicode
Efficiently Storing Lots of Text in RAM
Trying These Approaches on 8 Million Tokens
Tips for Using Less RAM
Probabilistic Data Structures
Very Approximate Counting with a 1-byte Morris Counter
K-Minimum Values
Bloom Filters
LogLog Counter
Real-World Example
12. Lessons from the Field
Adaptive Lab’s Social Media Analytics (SOMA)
Python at Adaptive Lab
SoMA’s Design
Our Development Methodology
Maintaining SoMA
Advice for Fellow Engineers
Making Deep Learning Fly with RadimRehurek.com
The Sweet Spot
Lessons in Optimizing
Wrap-Up
Large-Scale Productionized Machine Learning at Lyst.com
Pythons Place at Lyst
Cluster Design
Code Evolution in a Fast-Moving Start-Up
Building the Recommendation Engine
Reporting and Monitoring
Some Advice
Large-Scale Social Media Analysis at Smesh
Pythons Role at Smesh
The Platform
High Performance Real-Time String Matching
Reporting, Monitoring, Debugging, and Deployment
PyPy for Successful Web and Data Processing Systems
Prerequisites
The Database
The Web Application
OCR and Translation
Task Distribution and Workers
Conclusion
Task Queues at Lanyrd.com
Python’s Role at Lanyrd
Making the Task Queue Performant
Reporting, Monitoring, Debugging, and Deployment
Advice to a Fellow Developer
Index
部分内容试读
暂无.
关于此书评价
暂无.
书摘内容
《高性能Python(影印版)》:
For the loop in the code, rather than sending one value of i. at a time to the CPU, wewould like to send it both number_float and several values of i to check at the sametime. This is possible because the CPU vectorizes operations with no additional timecost, meaning it can do multiple independent computations at the same time. So, wewant to send number_float to the CPU cache, in addition to as many values of i as thecache can hold. For each of the number_float/i, pairs, we will divide them and check ifthe result is a whole number; then we will send a signal back indicating whether any ofthe values was indeed an integer. If so, the function ends. If not, we repeat. In this way,we only need to communicate back one result for many values of t, rather than de-pending on the slow bus for every value. This takes advantage of a CPU’s ability tovectorize a calculation, or run one instruction on multiple data in one clock cycle.This concept ofvectorization is illustrated by the following code:Here, we set up the processing such that the division and the checking for integers aredone on a set of five values of i at a time. If properly vectorized, the CPU can do thisline in one step as opposed to doing a separate calculation for every i. Ideally, theany(result) operation would also happen in the CPU without having to transfer theresults back to RAM. We will talk more about vectorization, how it works, and when itbenefits your code in Chapter 6.
……
高性能Python(影印版) [High Performance Pvthon]最新最全的试读、书评、目录、简介信息由Python中文网整理提供。
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试