Python Benchmarking: Measure The Execution Time Of Python Code With The time And timeit Modules (Python Concurrency By Example)
Language: English
Published by Independently published, 2023
- Softcover
- New

Seller: Ria Christie Collections, Uxbridge, United KingdomRia Christie Collections
5-star seller
AbeBooks seller since March 25, 2015
Softcover
Condition: New
US$ 32.05
US$ 16.21 shipping
Ships from United Kingdom to U.S.A.
Quantity: Over 20 available
Add to basketFree 30-day returns
Item description from seller
In.
Seller Inventory # ria9798865481171_new
- Title
- Python Benchmarking: Measure The Execution Time Of Python Code With The time And timeit Modules (Python Concurrency By Example)
- Author
- Brownlee, Jason
- Publisher
- Independently published
- Publication year
- 2023
- Condition
- New
- Binding
- Soft cover
- Language
- English
- ISBN 13
- 9798865481171
- Series
- Book 3 of 3: Python Concurrency By Example
Without benchmarking, we're working in the dark.
Python code can be slow.Benchmarking is a way of discovering exactly how long code takes to execute. Without benchmarking, we have no idea whether changes make code run faster or not.
You need to know:
- How to benchmark statements, functions, and programs using the time module.
- How to develop benchmarking helper functions, context managers, and decorators.
- How to benchmark snippets of code using the timeit module.
Benchmarking is required to develop fast Python code.
Python provides 5 built-in functions for reporting the current time. The problem is, that many developers use just one, the time() function, and are unaware of how inappropriate it is for benchmarking. Instead, we should be using the perf_counter() function.
Python also provides the timeit module with API and command line interface specifically designed for benchmarking. It encodes best practices such as repeated execution of target code and use of a high-precision timing function. Nevertheless, few developers use it because it is confusing. The trick is to adopt the "timeit" mindset.
Introducing: "Python Benchmarking". A new book designed to teach you how to bring modern benchmarking practices to your projects, super fast!
You will get fast-paced tutorials showing you how to benchmark your Python code, as well as some much-needed advice on advanced topics, such as:
- How to benchmark asyncio programs and coroutines.
- How to choose the precision and units of measure when reporting benchmark results.
- Why it is a good idea to repeat benchmark tests many times and report average results.
- How profiling is not benchmarking but can help in deciding what to optimize.
Each tutorial is carefully designed to teach one critical aspect of how to effectively benchmark Python code.
Table of Contents
- Tutorial 01: Introduction.
- Tutorial 02: Benchmarking Python.
- Tutorial 03: Benchmarking With time.time()
- Tutorial 04: Benchmarking With time.monotonic()
- Tutorial 05: Benchmarking With time.perf_counter()
- Tutorial 06: Benchmarking With time.thread_time()
- Tutorial 07: Benchmarking With time.process_time()
- Tutorial 08: Comparing time Module Functions
- Tutorial 09: Benchmark Metrics
- Tutorial 10: Benchmark Repetition
- Tutorial 11: Benchmark Reporting
- Tutorial 12: Benchmark Helper Function
- Tutorial 13: Benchmark Stopwatch Class
- Tutorial 14: Benchmark Context Manager
- Tutorial 15: Benchmark Function Decorator
- Tutorial 16: Gentle Introduction to Asyncio
- Tutorial 17: Benchmarking Asyncio With loop.time()
- Tutorial 18: Benchmark Helper Coroutine
- Tutorial 19: Benchmark Asynchronous Context Manager
- Tutorial 20: Benchmark Coroutine Decorator
- Tutorial 21: Benchmarking With The timeit Module
- Tutorial 22: Benchmarking With timeit.timeit()
- Tutorial 23: Benchmarking With The timeit Command Line
- Tutorial 24: Profile Python Code
- Tutorial 25: Benchmarking With The time Command
- Tutorial 26: Conclusions
Learn Python benchmarking correctly, step-by-step.
"Synopsis" may belong to another edition of this title.
Ria Christie Collections
Uxbridge, United Kingdom
5-star seller
AbeBooks seller since March 25, 2015
Shipping rates from United Kingdom to U.S.A.
| Item | 6 to 12 business days | 6 to 12 business days |
|---|---|---|
| First item | US$ 16.21 | US$ 16.21 |
Payment methods
Store description
Hello!
Ria Christie Collections is an online venture that was initially set up in 2012 to sell books. We do not have a physical high street store. We are professional online booksellers. We only sell brand new books in perfect condition that we source from various suppliers and the publishers.
Primarily, our aim is to provide an excellent service to all our customers. We always work as a team to achieve this.
Our other objectives are to:
1. Ensure that all our products reach their destination quickly in a safe and secure manner
2. Answer to all our customer queries within 24 hours
3. Ensure that our customers are happy with their purchases
4. Provide all the items at a competitive price
5. Always listen to our customers
Ria Christie Collections is not a registered company. It is a Sole Trader venture. Other key information is shown below:
Contact Person Name: Rakesh Luchmun (Mr)
Storefront Name: Ria Christie Collections
Place of Establishment Address:
Suite B; ARUN House; ARUN Building
Arundel Road
Uxbridge
UB8 2RR
United Kingdom
E-Mail Address: riachristie@hotmail.co.uk
VAT Number: GB 160 5650 25
We always work hard and aim to comply with all of Abebooks Policies.
If you have any issues, please do not hesitate to write to us whether before or after a purchase. We promise to reply to you promptly and, in any case, within 24 hours.
Thank you kindly!
Yours sincerely
Mr Rakesh Luchmun (Founder) and the Ria Christie Collections Team
Specialty
Educational books, Textbooks, Fiction, Non- fictionSeller's business information
Ryefield Investments Limited
175 Pield Heath Road
Uxbridge, United Kingdom UB8 3NL
Terms of sale
All Returns and Refund are as per Abebooks policies.
Shipping terms
Orders usually ship within 2 business days. If your book order is heavy or oversized, we may contact you to let you know extra shipping is required. Thank you!