~/talk

Architecting Native Python Extension Modules

Talkat PyBay 2024 · on Saturday, 2024-09-21· [python, c-and-cpp]
links:none on file
slides:none on file

Over 20% of the most downloaded Python modules use native extensions, and the core claims are concrete: crossing the FFI is expensive so batch operations or move hot loops into native code, the GIL becomes easier to avoid once Python objects are out of the hot path, and packaging requires building wheels for each OS/arch/Python. Recommended tools include pyo3 and pybind11, use a sampling profiler like ppy, separate Python-facing API from core logic into distinct packages or crates, and one example moved a Levenshtein hot loop into Rust and processed tens of thousands of files with large speedups.

AI-written summary · about

  1. 0:00Introduction to native extensions
  2. 1:06What are native extension modules
  3. 2:31When to use native extensions
  4. 5:23Performance with FFI calls
  5. 6:46Architecture patterns for extensions
  6. 8:33Key takeaways and summary
  7. 8:53Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.