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

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.

主站蜘蛛池模板: 肇源县| 策勒县| 肇州县| 张掖市| 泗水县| 靖边县| 保靖县| 藁城市| 郁南县| 四子王旗| 临颍县| 新干县| 玉屏| 洪泽县| 昌宁县| 万安县| 盐源县| 平潭县| 景洪市| 玛纳斯县| 榕江县| 岳普湖县| 桂阳县| 仪征市| 新源县| 南木林县| 龙游县| 平原县| 乐昌市| 潍坊市| 沂源县| 长宁区| 新干县| 横峰县| 康马县| 湛江市| 兰考县| 大余县| 湾仔区| 且末县| 毕节市|