Submit Search
Upload
Dive into CPython Bytecode
•
Download as ODP, PDF
•
1 like
•
1,895 views
Alex Gaynor
Follow
My slides from my 2009 DjangoCon lightning talk on CPython bytecode.
Read less
Read more
Technology
Sports
Report
Share
Report
Share
1 of 23
Download now
Recommended
Python with a SWIG of c++
Python with a SWIG of c++
bobmcn
tokyotalk
tokyotalk
Hiroshi Ono
Código para Latch físico: Touch_calibrate.py
Código para Latch físico: Touch_calibrate.py
Chema Alonso
.Net 4.0 Threading and Parallel Programming
.Net 4.0 Threading and Parallel Programming
Alex Moore
Strings1
Strings1
Michael Gordon
Hello world program
Hello world program
Spy Seat
python gil
python gil
rfyiamcool
1.3 core programming [identify the appropriate method for handling repetition]
1.3 core programming [identify the appropriate method for handling repetition]
tototo147
Recommended
Python with a SWIG of c++
Python with a SWIG of c++
bobmcn
tokyotalk
tokyotalk
Hiroshi Ono
Código para Latch físico: Touch_calibrate.py
Código para Latch físico: Touch_calibrate.py
Chema Alonso
.Net 4.0 Threading and Parallel Programming
.Net 4.0 Threading and Parallel Programming
Alex Moore
Strings1
Strings1
Michael Gordon
Hello world program
Hello world program
Spy Seat
python gil
python gil
rfyiamcool
1.3 core programming [identify the appropriate method for handling repetition]
1.3 core programming [identify the appropriate method for handling repetition]
tototo147
LCDS - State Presentation
LCDS - State Presentation
Ruochun Tzeng
Introduction to nand2 tetris
Introduction to nand2 tetris
Yodalee
Q4.11: NEON Intrinsics
Q4.11: NEON Intrinsics
Linaro
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Peter Breuer
Parallel Computing Example with Raspberry Pi Cluster
Parallel Computing Example with Raspberry Pi Cluster
Herpiko Dwi Aguno
Introduction to RevKit
Introduction to RevKit
Mathias Soeken
Exercice.docx
Exercice.docx
imane26
How to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatter
Yoshifumi Kawai
异步io框架的实现
异步io框架的实现
rfyiamcool
Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010
Dirkjan Bussink
Custard pi 7 user information
Custard pi 7 user information
Seggy Segaran
Assembly language part I
Assembly language part I
Mohammed A. Imran
Introduction to cython
Introduction to cython
John(Qiang) Zhang
Faster Python, FOSDEM
Faster Python, FOSDEM
Victor Stinner
LED Blinking Using Raspberry Pi
LED Blinking Using Raspberry Pi
Arjun R Krishna
Why is a[1] fast than a.get(1)
Why is a[1] fast than a.get(1)
kao kuo-tung
Sol7
Sol7
University Of Lahore
Format String Vulnerability
Format String Vulnerability
Jian-Yu Li
C coroutine
C coroutine
Chien-Wei Huang
pdb like a pro
pdb like a pro
Philip Bauer
Protostar VM - Heap3
Protostar VM - Heap3
UTD Computer Security Group
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
Andrey Karpov
More Related Content
What's hot
LCDS - State Presentation
LCDS - State Presentation
Ruochun Tzeng
Introduction to nand2 tetris
Introduction to nand2 tetris
Yodalee
Q4.11: NEON Intrinsics
Q4.11: NEON Intrinsics
Linaro
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Peter Breuer
Parallel Computing Example with Raspberry Pi Cluster
Parallel Computing Example with Raspberry Pi Cluster
Herpiko Dwi Aguno
Introduction to RevKit
Introduction to RevKit
Mathias Soeken
Exercice.docx
Exercice.docx
imane26
How to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatter
Yoshifumi Kawai
异步io框架的实现
异步io框架的实现
rfyiamcool
Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010
Dirkjan Bussink
Custard pi 7 user information
Custard pi 7 user information
Seggy Segaran
Assembly language part I
Assembly language part I
Mohammed A. Imran
Introduction to cython
Introduction to cython
John(Qiang) Zhang
Faster Python, FOSDEM
Faster Python, FOSDEM
Victor Stinner
LED Blinking Using Raspberry Pi
LED Blinking Using Raspberry Pi
Arjun R Krishna
Why is a[1] fast than a.get(1)
Why is a[1] fast than a.get(1)
kao kuo-tung
Sol7
Sol7
University Of Lahore
Format String Vulnerability
Format String Vulnerability
Jian-Yu Li
C coroutine
C coroutine
Chien-Wei Huang
pdb like a pro
pdb like a pro
Philip Bauer
What's hot
(20)
LCDS - State Presentation
LCDS - State Presentation
Introduction to nand2 tetris
Introduction to nand2 tetris
Q4.11: NEON Intrinsics
Q4.11: NEON Intrinsics
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Certifying (RISC) Machine Code Safe from Aliasing (OpenCert 2013)
Parallel Computing Example with Raspberry Pi Cluster
Parallel Computing Example with Raspberry Pi Cluster
Introduction to RevKit
Introduction to RevKit
Exercice.docx
Exercice.docx
How to make the Fastest C# Serializer, In the case of ZeroFormatter
How to make the Fastest C# Serializer, In the case of ZeroFormatter
异步io框架的实现
异步io框架的实现
Rubinius @ RubyAndRails2010
Rubinius @ RubyAndRails2010
Custard pi 7 user information
Custard pi 7 user information
Assembly language part I
Assembly language part I
Introduction to cython
Introduction to cython
Faster Python, FOSDEM
Faster Python, FOSDEM
LED Blinking Using Raspberry Pi
LED Blinking Using Raspberry Pi
Why is a[1] fast than a.get(1)
Why is a[1] fast than a.get(1)
Sol7
Sol7
Format String Vulnerability
Format String Vulnerability
C coroutine
C coroutine
pdb like a pro
pdb like a pro
Similar to Dive into CPython Bytecode
Protostar VM - Heap3
Protostar VM - Heap3
UTD Computer Security Group
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
Andrey Karpov
Creating your own Abstract Processor
Creating your own Abstract Processor
Aodrulez
Python Compiler Internals Presentation Slides
Python Compiler Internals Presentation Slides
Tom Lee
Diving into byte code optimization in python
Diving into byte code optimization in python
Chetan Giridhar
Such a weird Processor: messing with opcodes (...and a little bit of PE) (Has...
Such a weird Processor: messing with opcodes (...and a little bit of PE) (Has...
Ange Albertini
Working with Bytecode
Working with Bytecode
Marcus Denker
vJUG Getting C C++ performance out of java
vJUG Getting C C++ performance out of java
C24 Technologies
A 64-bit horse that can count
A 64-bit horse that can count
Andrey Karpov
The article is a report about testing of portability of Loki library with 64-...
The article is a report about testing of portability of Loki library with 64-...
PVS-Studio
[JSDC 2016] Codex: Conditional Modules Strike Back
[JSDC 2016] Codex: Conditional Modules Strike Back
Alex Liu
Python 3000
Python 3000
Bob Chao
Optimization in the world of 64-bit errors
Optimization in the world of 64-bit errors
PVS-Studio
Compose Code Camp (1).pptx
Compose Code Camp (1).pptx
MadheswarKonidela
Devoxx MA 2015 - Turn you java objects into binary
Devoxx MA 2015 - Turn you java objects into binary
C24 Technologies
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)
Андрей Новиков
Cpp17 and Beyond
Cpp17 and Beyond
ComicSansMS
x86 & PE
x86 & PE
Ange Albertini
There are two types of ciphers - Block and Stream. Block is used to .docx
There are two types of ciphers - Block and Stream. Block is used to .docx
relaine1
The CppCat Analyzer Checks TortoiseGit
The CppCat Analyzer Checks TortoiseGit
Andrey Karpov
Similar to Dive into CPython Bytecode
(20)
Protostar VM - Heap3
Protostar VM - Heap3
C++ Code as Seen by a Hypercritical Reviewer
C++ Code as Seen by a Hypercritical Reviewer
Creating your own Abstract Processor
Creating your own Abstract Processor
Python Compiler Internals Presentation Slides
Python Compiler Internals Presentation Slides
Diving into byte code optimization in python
Diving into byte code optimization in python
Such a weird Processor: messing with opcodes (...and a little bit of PE) (Has...
Such a weird Processor: messing with opcodes (...and a little bit of PE) (Has...
Working with Bytecode
Working with Bytecode
vJUG Getting C C++ performance out of java
vJUG Getting C C++ performance out of java
A 64-bit horse that can count
A 64-bit horse that can count
The article is a report about testing of portability of Loki library with 64-...
The article is a report about testing of portability of Loki library with 64-...
[JSDC 2016] Codex: Conditional Modules Strike Back
[JSDC 2016] Codex: Conditional Modules Strike Back
Python 3000
Python 3000
Optimization in the world of 64-bit errors
Optimization in the world of 64-bit errors
Compose Code Camp (1).pptx
Compose Code Camp (1).pptx
Devoxx MA 2015 - Turn you java objects into binary
Devoxx MA 2015 - Turn you java objects into binary
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)
Cpp17 and Beyond
Cpp17 and Beyond
x86 & PE
x86 & PE
There are two types of ciphers - Block and Stream. Block is used to .docx
There are two types of ciphers - Block and Stream. Block is used to .docx
The CppCat Analyzer Checks TortoiseGit
The CppCat Analyzer Checks TortoiseGit
Recently uploaded
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Puma Security, LLC
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Principled Technologies
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
Radu Cotescu
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
HampshireHUG
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
wesley chun
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Malak Abu Hammad
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Miguel Araújo
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Igalia
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
The Digital Insurer
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
Delhi Call girls
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Results
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Katpro Technologies
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
Pixlogix Infotech
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Safe Software
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
naman860154
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
sudhanshuwaghmare1
Recently uploaded
(20)
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Dive into CPython Bytecode
1.
Dive into CPython
Bytecode Alex Gaynor
2.
I don't need
to know that stuff
3.
You don't.
But it's totally helpful.
4.
How does CPython
Make Bytecode?
5.
Tokenize the source
6.
Parse the tokens
into an AST
7.
Build a symbol
table to figure out what's a global
8.
Compile to bytecode
9.
Now I can
haz bytecode
10.
Now that I
has a bytecode how does I see it?
11.
>>> def f(o):
... return o >>> import dis >>> dis.dis(f) 2 0 LOAD_FAST 0 (o) 3 RETURN_VALUE
12.
So use the
dis module
13.
So now that
we have bytecode, what do we do with it?
14.
Well, what are
those bytecodes?
15.
16.
Python VM is
stack based
17.
So now we
know some bytecodes, what can we do with this knowledge
18.
19.
20.
21.
Less Bytecode ==
faster!
22.
More specialized bytecodes
== faster
23.
@alex_gaynor Thanks
Download now