~/talk

Writing Python Bindings for C++ Libraries: Easy-to-use Performance

Talkat CppCon 2023 · on Friday, 2023-10-06· at 13:30· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard· [python]
links:none on file
slides:none on file

Shows how C++ libraries compile into Python extension modules via the CPython C API and compares pybind11 boost::python and Cython implementations with microbenchmarks (pure CPython call ~67 ns CPython C API ~74 ns pybind11 slower boost slightly slower). Builds a file-reader API that uses return-internal lifetime handling, Vector indexing suites, GIL release for parallel readers, and capsules to cache C function pointers (micro-optimization saves ~300 ns per hot call). Produces working examples, discusses exception costs and Wheels distribution.

AI-written summary · about

  1. 0:00Python bindings for C++ intro
  2. 3:57Combining Python and C++
  3. 9:57Python extension modules
  4. 13:33Binding libraries benchmarks
  5. 16:23Clean Python APIs for C++
  6. 21:01Custom binary format reader
  7. 27:19Object lifetimes and references
  8. 31:57Exceptions and threading
  9. 34:26Multi-threaded HTTP server
  10. 40:43Optimizing hot loops
  11. 47:08NumPy/Pandas lessons
  12. 53:13Choosing binding library
  13. 58:39Distribution and user experience
  14. 1:00:02Type annotations
~/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.