From 3 to 300 fps: NES Emulation in Python and Cython
summary
A working Python NES emulator starts at about two to three frames per second and after porting hot inner loops to Cython with a few native type annotations it jumps above 300fps, proving Python plus Cython yields native speed without rewriting everything. The build includes CPU, PPU, audio and cartridge logic, it runs headless and playable though absurdly fast, and Cython introduces compilation, platform wheels, possible unsafe pointers and GC leaks to watch for.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:26What's in this Talk
- 1:10What is Emulation?
- 2:53Why Emulate?
- 5:35Why Emulate in Python?
- 7:22V1: a NES in Python
- 12:07V1: it boots! But...
- 13:35Making it faster
- 16:28Cython and Optimization Fits with Optimization Principle
- 18:45V2: 100x faster!
- 19:46Challenges & Hazards
- 22:08Lessons For My Day Job
- 24:00The End
related talks
33mEasy wins with Cython: fast and multi-core
40mGet native with Cython
33mPython vs Punch Out
33mA low latency deepdive of Python with Cython
42mLift your Speed Limits with Cython
57mGame Programming with Python
36mHow to Optimize your Python Program for Slowness
22mPyPy and the future of the Python ecosystem
