~/talk

CFFI, Ctypes, Cython The Good, The Bad and The Ugly

Talkat PyCon Israel 2017 · 2017-06-11..06-13· [c-and-cpp, python]
links:none on file
slides:none on file

Produces a Mandelbrot image in pure Python and C, then reuses the C code from Python via Ctypes vs CFFI vs Cython and times each approach. Pure Python needs 5.2 s, native C 200 ms (~26× faster). The pipeline makes 1.5 million calls into the inner function; Ctypes yields ~2.5 s for that pattern, CFFI and Cython land near C (about 200 ms vs 5.2 s reported). Notes cover pointer ownership, memory copying, header/compile requirements, and maintainability tradeoffs.

AI-written summary · about

  1. 0:00Introduction and goals
  2. 1:02Defining the test case
  3. 3:05Python and C implementation
  4. 6:56Performance benchmarking
  5. 10:32Using Ctypes
  6. 17:34Using CFFI
  7. 20:45Using Cython
  8. 24:23Final comparison and tips
~/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.