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

고성능 파이썬(2판)

by 오현석, 미샤 고렐릭, 이안 오스발트
May 2021
Beginner to intermediate
528 pages
11h 27m
Korean
Hanbit Media, Inc.
Content preview from 고성능 파이썬(2판)
82
고성능 파이썬(2판)
그림
2-8
큰 리스트를
2
개 없앤 다음의
memory
_
profiler
리포트
시간(단위: 초)
메모리 사용량(단위: MiB)
83
2
프로파일링으로 병목 지점 찾기
예제
2-12
복소수 좌표를 즉시 만들어
RAM
을 절약하기
@profile
def
calculate_z_serial_purepython(maxiter, x, y):
"
""
줄리아 갱신 규칙에 따라 출력 리스트 계산 "
""
output = []
for
ycoord
in
y:
for
xcoord
in
x:
z = complex(xcoord, ycoord)
c = complex(c_real, c_imag)
n = 0
while
n < maxiter
and
abs(z) < 2:
z = z * z + c
n += 1
output.append(n)
return
output
여러 명령의
RAM
사용량을 측정하려면
IPython
의 매직 명령어인
%
memit
을 사용할 수 있다.
%
memit
%
timeit
과 비슷하게 작동한다.
11
장에서는
%
memit
을 사용해 리스트의 메모리 비
용을 측정하고,
RAM
을 더 ...
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