더북(TheBook)

프로파일러를 다시 실행해서 새로운 프로파일러 통계 표를 얻었다. 이전의 insert_value 함수에 비해 새로 정의한 함수의 누적 실행 시간이 거의 40배 가까이 줄어들었음을 알 수 있다.

>>>
       62211 function calls in 0.067 seconds

  Ordered by: cumulative time

  ncalls tottime percall cumtime percall filename:lineno(function)
       1   0.000   0.000   0.067   0.067 main.py:35(<lambda>)
       1   0.002   0.002   0.067   0.067 main.py:10(insertion_sort)
   20736   0.004   0.000   0.064   0.000 main.py:109(insert_value)
   20736   0.056   0.000   0.056   0.000 {method 'insert' of 'list' objects}
   20736   0.004   0.000   0.004   0.000 {built-in method _bisect.bisect_left}