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

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.

主站蜘蛛池模板: 东乌珠穆沁旗| 陆川县| 漳浦县| 花莲市| 安庆市| 衡南县| 小金县| 华蓥市| 巫溪县| 绥中县| 青海省| 津市市| 鞍山市| 得荣县| 沛县| 工布江达县| 老河口市| 彭阳县| 仁化县| 榆社县| 广汉市| 天津市| 漳浦县| 红安县| 额敏县| 延吉市| 循化| 株洲县| 涞源县| 建宁县| 平度市| 鄂州市| 富顺县| 宜良县| 丹寨县| 文昌市| 周口市| 厦门市| 常山县| 运城市| 琼结县|