Binary Python: Introducing Native Code
summary
Parsing huge JavaScript source maps moves from seconds to under 100 milliseconds by reimplementing the hot path in Rust and keeping large structures in native memory instead of exposing Python objects. Build strategy uses CFFI shims, setuptools wheel-tag hacks and cross-builds in manylinux Docker images, cutting a 15‑variant build matrix down to three platform wheels. LLVM-dependent native symbolication and macOS SDK tricks are brittle but reproducible; release artifacts upload remains a manual GitHub→twine step.
AI-written summary · about
chapters (14)
- 0:00Context and motivation
- 1:23Native code in python
- 2:32Building native libraries
- 4:38Binary distribution challenges
- 6:28Python wheels explained
- 8:23Managing dependency tags
- 11:45The manylinux standard
- 13:46Simplifying the build process
- 15:27Customizing setuptools
- 17:46CFFI for interfacing
- 20:37Creating Python wrappers
- 22:54CI/CD and cross-building
- 26:57Error handling across borders
- 29:19Lessons learned and conclusion
