Python Concurrency by Example Python Benchmarking: Measure The Execution Time Of Python Code With The time And timeit Modules, Book 3, (Paperback)

Python Concurrency by Example Python Benchmarking: Measure The Execution Time Of Python Code With The time And timeit Modules, Book 3, (Paperback)

(No ratings yet)

Key item features

  • Python Concurrency by Example Python Benchmarking: Measure The Execution Time Of Python Code With The time And timeit Modules, Book 3, (Paperback)
  • Author: Independently Published
  • ISBN: 9798865481171
  • Format: Paperback
  • Publication Date: 2023-10-25
  • Page Count: 378

Specs

Publication date, October, 2023Author, Independently PublishedBook format, PaperbackGenre, Computing & InternetPages, 378Age group, Adult

About this item

Product details

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
  • Python Concurrency by Example Python Benchmarking: Measure The Execution Time Of Python Code With The time And timeit Modules, Book 3, (Paperback)
  • Author: Independently Published
  • ISBN: 9798865481171
  • Format: Paperback
  • Publication Date: 2023-10-25
  • Page Count: 378
info:
We aim to show you accurate product information. Manufacturers, suppliers and others provide what you see here, and we have not verified it.  

Specifications

Publication date

October, 2023

Author

Independently Published

Book format

Paperback

Genre

Computing & Internet

Warranty

Warranty information

Please be aware that the warranty terms on items offered for sale by third party Marketplace sellers may differ from those displayed in this section (if any). To confirm warranty terms on an item offered for sale by a third party Marketplace seller, please use the 'Contact seller' feature on the third party Marketplace seller's information page and request the item's warranty terms prior to purchase.

Customer ratings & reviews

0 out of 5 stars
0 ratings|0 reviews
This item does not have any reviews yet
Current price is $27.00
Price when purchased online
  • Free 90-day returns
$27.00
Out of stock

How do you want your item?

Try 30 days for just $1! Choose a plan at checkout.
How do you want your item?
Ships to
Arrives by Fri, Nov 13
Sold and shipped by Walmart.com
Free 90-day returns
This item is gift eligible
Other sellers
$26.23
+Free shipping
Shipping, arrives by Mon, Nov 16 to Columbus, 43215
Sold and shipped by Alibris Books
Free Holiday returns until Jan 31
walmart plus

Try 30 days of Walmart+ for just $1!

T&C apply.