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

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.

主站蜘蛛池模板: 桦甸市| 阳新县| 普宁市| 微山县| 安达市| 青铜峡市| 阿拉善左旗| 临沭县| 准格尔旗| 通辽市| 白沙| 紫金县| 巢湖市| 彭水| 江陵县| 台东县| 禹州市| 渝北区| 盐山县| 鹤壁市| 离岛区| 上饶市| 宁明县| 天峨县| 碌曲县| 巴彦淖尔市| 华阴市| 浑源县| 武清区| 江华| 右玉县| 商都县| 丰原市| 台南市| 盘山县| 宁陵县| 隆昌县| 赫章县| 海伦市| 石嘴山市| 富源县|