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

Introduction

Although Python is generally known (a bit unfairly) as a slow language, it is possible to achieve very good performance with the right methods. This is the objective of this chapter and the next. This chapter describes how to evaluate (profile) what makes a program slow, and how this information can be used to optimize the code and make it more efficient. The next chapter will deal with more advanced high-performance computing methods that should only be tackled when the methods described here are not sufficient.

The recipes of this chapter are organized into three parts:

  • Time and memory profiling: Evaluating the performance of code
  • NumPy optimization: Using NumPy more efficiently, particularly with large arrays
  • Memory mapping with arrays: Implementing memory mapping techniques for out-of-core computations on huge arrays, notably with the HDF5 file format
主站蜘蛛池模板: 吐鲁番市| 当阳市| 东乌| 景洪市| 麻阳| 静安区| 金堂县| 天全县| 林芝县| 平利县| 且末县| 锡林浩特市| 海口市| 蒲江县| 佳木斯市| 泰安市| 广德县| 莒南县| 朔州市| 新乐市| 印江| 雅安市| 封开县| 青州市| 辽源市| 镇宁| 清新县| 盘锦市| 曲水县| 沙雅县| 沙坪坝区| 垦利县| 磐石市| 息烽县| 虎林市| 柘荣县| 隆子县| 河津市| 临邑县| 改则县| 东海县|