Skip to Content
고성능 파이썬(2판)
book

고성능 파이썬(2판)

by 오현석, 미샤 고렐릭, 이안 오스발트
May 2021
Beginner to intermediate
528 pages
11h 27m
Korean
Hanbit Media, Inc.
Content preview from 고성능 파이썬(2판)
73
2
프로파일링으로 병목 지점 찾기
7
장에서 소개할 사이썬이나
PyPy
를 사용하면 이 문제를 해결하여 성능 향상을 기대할 수
있다.
다음과 같은 이유로 개선 결과를 확신할 수 있다.
쉽게 검증할 수 있는 가설을 세웠다.
그 가설을 검증할 수 있도록 코드를 수정했고, 한 번에 한 가지만 검사했다 (두 가설을 절대 한꺼번에 검
증하지 말라! )
결론을 뒷받침하기에 충분한 근거를 수집했다.
마지막으로 두 주요 함수에 대해
kernprof
.
py
를 실행하여 최적화를 끝낸 코드의 전체 복잡도
를 살펴보자.
예제
2-8
while
문의 조건 검사 순서를 바꿔 실행 속도를 약간 개선함
$ kernprof -l -v julia1_lineprofiler3.py
...
Wrote profile results to julia1_lineprofiler3.py.lprof
Timer unit: 1e-06 s
Total time: 48.9154 s
File: julia1_lineprofiler3.py
Function: calculate_z_serial_purepython at line 9
Line # Hits Per Hit % Time Line Contents
=======================================================
9 @profile
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
엑셀이 편해지는 파이썬

엑셀이 편해지는 파이썬

펠릭스 춤슈타인
핸즈온 비지도 학습

핸즈온 비지도 학습

강재원, 권재철, 안쿠르 A. 파텔

Publisher Resources

ISBN: 9791162244210