- Python High Performance(Second Edition)
- Gabriele Lanaro
- 251字
- 2021-07-09 21:01:55
Pure Python Optimizations
As mentioned in the last chapter, one of the most effective ways of improving the performance of applications is through the use of better algorithms and data structures. The Python standard library provides a large variety of ready-to-use algorithms and data structures that can be directly incorporated in your applications. With the tools learned from this chapter, you will be able to use the right algorithm for the task and achieve massive speed gains.
Even though many algorithms have been around for quite a while, they are especially relevant in today's world as we continuously produce, consume, and analyze ever increasing amounts of data. Buying a larger server or microoptimizing can work for some time, but achieving better scaling through algorithmic improvement can solve the problem once and for all.
In this chapter, we will understand how to achieve better scaling using standard algorithms and data structures. More advanced use cases will also be covered by taking advantage of third-party libraries. We will also learn about tools to implement caching, a technique used to achieve faster response times by sacrificing some space on memory or on disk.
The list of topics to be covered in this chapter is as follows:
- Introduction to computational complexity
- Lists and deques
- Dictionaries
- How to build an inverted index using a dictionary
- Sets
- Heaps and priority queues
- Implementing autocompletion using tries
- Introduction to caching
- In-memory caching with the functools.lru_cache decorator
- On-disk cache with joblib.Memory
- Fast and memory-efficient loops with comprehensions and generators
- 精通Nginx(第2版)
- Java面向?qū)ο筌浖_發(fā)
- 深入淺出Java虛擬機(jī):JVM原理與實(shí)戰(zhàn)
- oreilly精品圖書:軟件開發(fā)者路線圖叢書(共8冊)
- 教孩子學(xué)編程:C++入門圖解
- Building a Quadcopter with Arduino
- 基于Swift語言的iOS App 商業(yè)實(shí)戰(zhàn)教程
- Mastering ServiceNow(Second Edition)
- JavaScript:Moving to ES2015
- Python編程實(shí)戰(zhàn)
- Java:High-Performance Apps with Java 9
- Red Hat Enterprise Linux Troubleshooting Guide
- 動手打造深度學(xué)習(xí)框架
- Python計(jì)算機(jī)視覺與深度學(xué)習(xí)實(shí)戰(zhàn)
- Flink原理深入與編程實(shí)戰(zhàn):Scala+Java(微課視頻版)