官术网_书友最值得收藏!

Summary

In this chapter, we introduced the basic principles of optimization and applied those principles to a test application. When optimizing, the first thing to do is test and identify the bottlenecks in the application. We saw how to write and time a benchmark using the time Unix command, the Python timeit module, and the full-fledged pytest-benchmark package. We learned how to profile our application using cProfile, line_profiler, and memory_profiler, and how to analyze and navigate the profiling data graphically with KCachegrind.

In the next chapter, we will explore how to improve performance using algorithms and data structures available in the Python standard library. We will cover scaling, sample usage of several data structures, and learn techniques such as caching and memoization.

主站蜘蛛池模板: 民丰县| 堆龙德庆县| 郓城县| 东宁县| 岑溪市| 蒲江县| 琼结县| 清镇市| 陆河县| 西峡县| 南城县| 沂水县| 龙游县| 菏泽市| 如东县| 丰镇市| 洮南市| 五莲县| 靖州| 玛曲县| 赣州市| 调兵山市| 敦煌市| 岳阳市| 沅江市| 通河县| 彭山县| 承德县| 崇阳县| 富蕴县| 汕尾市| 福泉市| 同仁县| 哈巴河县| 汤阴县| 北碚区| 察哈| 黄浦区| 昌乐县| 大英县| 射洪县|