Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Software Architecture with Python

You're reading from   Software Architecture with Python Design and architect highly scalable, robust, clean, and high performance applications in Python

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781786468529
Length 556 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Anand Balachandran Pillai Anand Balachandran Pillai
Author Profile Icon Anand Balachandran Pillai
Anand Balachandran Pillai
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Principles of Software Architecture FREE CHAPTER 2. Writing Modifiable and Readable Code 3. Testability – Writing Testable Code 4. Good Performance is Rewarding! 5. Writing Applications that Scale 6. Security – Writing Secure Code 7. Design Patterns in Python 8. Python – Architectural Patterns 9. Deploying Python Applications 10. Techniques for Debugging Index

Performance complexity


It would be helpful to spend some time discussing what we mean by the performance complexity of code before we jump into code examples in Python and discuss tools to measure and optimize performance.

The performance complexity of a routine or function is defined in terms of how they respond to changes in the input size typically in terms of the time spent in executing the code.

This is usually represented by the so-called Big-O notation which belongs to a family of notations called the Bachmann–Landau notation or asymptotic notation.

The letter O is used as the rate of growth of a function with respect to input size - also called the order of the function.

Commonly used Big-O notations or function orders are shown in the following table in order of increasing complexity:

#

Order

Complexity

Example

1

O(1)

Constant

Looking for a key in a constant look-up table such as a HashMap or dictionary in Python

2

O(log (n))

Logarithmic

Searching for an item in a sorted...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime