Most ebook files are in PDF format, so you can easily read them using various software such as Foxit Reader or directly on the Google Chrome browser.
Some ebook files are released by publishers in other formats such as .awz, .mobi, .epub, .fb2, etc. You may need to install specific software to read these formats on mobile/PC, such as Calibre.
Please read the tutorial at this link. https://ebooknice.com/page/post?id=faq
We offer FREE conversion to the popular formats you request; however, this may take some time. Therefore, right after payment, please email us, and we will try to provide the service as quickly as possible.
For some exceptional file formats or broken links (if any), please refrain from opening any disputes. Instead, email us first, and we will try to assist within a maximum of 6 hours.
EbookNice Team
Status:
Available0.0
0 reviewsISBN 10: 1783989300
ISBN 13: 9781783989300
Author: Fernando Doglio
Simply knowing how to code is not enough; on mission-critical pieces of code, every bit of memory and every CPU cycle counts, and knowing how to squish every bit of processing power out of your code is a crucial and sought-after skill. Nowadays, Python is used for many scientific projects, and sometimes the calculations done in those projects require some serious fine-tuning. Profilers are tools designed to help you measure the performance of your code and help you during the optimization process, so knowing how to use them and read their output is very handy. This book starts from the basics and progressively moves on to more advanced topics. You’ll learn everything from profiling all the way up to writing a real-life application and applying a full set of tools designed to improve it in different ways. In the middle, you’ll stop to learn about the major profilers used in Python and about some graphic tools to help you make sense of their output. You’ll then move from generic optimization techniques onto Python-specific ones, going over the main constructs of the language that will help you improve your speed without much of a change. Finally, the book covers some number-crunching-specific libraries and how to use them properly to get the best speed out of them. After reading this book, you will know how to take any Python code, profile it, find out where the bottlenecks are, and apply different techniques to remove them.
What you will learn
Master code optimization stepbystep and learn how to use different tools
Understand what a profiler is and how to read its output
Interpret visual output from profiling tools and improve the performance of your script
Use Cython to create fast applications using Python and C
Take advantage of PyPy to improve performance of Python code
Optimize numbercrunching code with NumPy, Numba, Parakeet, and Pandas
1. Profiling 101
What is profiling?
Event-based profiling
Statistical profiling
The importance of profiling
What can we profile?
Execution time
Where are the bottlenecks?
Memory consumption and memory leaks
The risk of premature optimization
Running time complexity
Constant time – O(1)
Linear time – O(n)
Logarithmic time – O(log n)
Linearithmic time – O(nlog n)
Factorial time – O(n!)
Quadratic time – O(n^)
Profiling best practices
Build a regression-test suite
Mind your code
Be patient
Gather as much data as you can
Preprocess your data
Visualize your data
Summary
2. The Profilers
Getting to know our new best friends: the profilers
cProfile
A note about limitations
The API provided
The Stats class
Profiling examples
Fibonacci again
Tweet stats
line_profiler
kernprof
Some things to consider about kernprof
Profiling examples
Back to Fibonacci
Inverted index
getOffsetUpToWord
getWords
list2dict
readFileContent
saveIndex
__start__
getOffsetUpToWord
getWords
list2dict
saveIndex
Summary
3. Going Visual – GUIs to Help Understand Profiler Output
KCacheGrind – pyprof2calltree
Installation
Usage
A profiling example – TweetStats
A profiling example – Inverted Index
RunSnakeRun
Installation
Usage
Profiling examples – the lowest common multiplier
A profiling example – search using the inverted index
Summary
4. Optimize Everything
Memoization / lookup tables
Performing a lookup on a list or linked list
Simple lookup on a dictionary
Binary search
Use cases for lookup tables
Usage of default arguments
List comprehension and generators
ctypes
Loading your own custom C library
Loading a system library
String concatenation
Other tips and tricks
Summary
5. Multithreading versus Multiprocessing
Parallelism versus concurrency
Multithreading
Threads
Creating a thread with the thread module
Working with the threading module
Interthread communication with events
Multiprocessing
Multiprocessing with Python
Exit status
Process pooling
Interprocess communication
Pipes
Events
Summary
6. Generic Optimization Options
PyPy
Installing PyPy
A Just-in-time compiler
Sandboxing
Optimizing for the JIT
Think of functions
Consider using cStringIO to concatenate strings
Actions that disable the JIT
Code sample
Cython
Installing Cython
Building a Cython module
Calling C functions
Solving naming conflicts
Defining types
Defining types during function definitions
A Cython example
When to define a type
Limitations
Generator expressions
Comparison of char* literals
Tuples as function arguments
Stack frames
How to choose the right option
When to go with Cython
When to go with PyPy
Summary
7. Lightning Fast Number Crunching with Numba, Parakeet, and pandas
Numba
Installation
Using Numba
Numba's code generation
Eager compilation
Other configuration settings
No GIL
NoPython mode
Running your code on the GPU
The pandas tool
Installing pandas
Using pandas for data analysis
Parakeet
Installing Parakeet
How does Parakeet work?
Summary
8. Putting It All into Practice
The problem to solve
Getting data from the Web
Postprocessing the data
The initial code base
Analyzing the code
Scraper
Analyzer
Summary
Index
mastering python high performance
high performance python 2nd edition pdf
python high performance - second edition
python high performance
mastering python
Tags: Fernando Doglio, Mastering, Python