Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
고성능 파이썬(2판)
by
오현석
,
미샤 고렐릭
,
이안 오스발트
May 2021
Beginner to intermediate
528 pages
11h 27m
Korean
Hanbit Media, Inc.
Content preview from
고성능 파이썬(2판)
425
11
장
RAM 덜 사용하기
예제
11-11
파이썬
3
.
x
에서는 유니코드 객체가 바이트 객체만큼 비용이 쌀 수도 있다
In [1]: %load_ext memory_profiler
In [2]: type(b
"
b
"
)
Out[2]: bytes
In [3]: %memit b
"
a
"
* int(1e8)
peak memory: 121.55 MiB, increment: 78.17 MiB
In [4]: type("u
"
)
Out[4]: str
In [5]: %memit "u
"
* int(1e8)
peak memory: 122.43 MiB, increment: 78.49 MiB
In [6]: %memit "Σ
"
* int(1e8)
peak memory: 316.40 MiB, increment: 176.17 MiB
이와 달리 시그마 문자
(∑)
는
UTF
-
8
에서
2
바이트를 차지한다.
PEP
393
(
http
://
www
.
python
.
org
/
dev
/
peps
/
pep
-
0393
/
)
덕에 파이썬
3
.
3
에서는 유연한 유니코드 표현을 사용한
다. 파이썬
3
.
3
에서는 문자열에 속한 문자들의 범위를 관찰해서 낮은 수준의 문자
(
아스키 등
)
는 가능한 한 더 적은 바이트를 사용하도록 한다.
유니코드를
UTF
-
8
로 인코딩하면 아스키 문자는
1
바이트를 사용하며, 사용 빈도가 덜한 문자
는 더 많은 바이트를 사용한다. ...
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
전문가를 위한 파이썬(2판)
루시아누 하말류
엑셀이 편해지는 파이썬
펠릭스 춤슈타인
핸즈온 비지도 학습
강재원, 권재철, 안쿠르 A. 파텔
Publisher Resources
ISBN: 9791162244210