~/talk

When and How to Try with Your Own C-Extensions

Talkat SciPy 2023 · 2023-07-10..07-16· [python, compilers-and-language-design]
links:none on file
slides:none on file

Claims that beating NumPy is hard and demonstrates a practical C-extension for finding the first True in 1D/2D Boolean arrays, with concrete implementations and timings. It implements a slow PyObject approach (orders of magnitude worse), a faster PyArray_GetPtr cast path, an npy_iter version, contiguous pointer arithmetic with loop unrolling, and a fastest uint64 forward scan that outperforms np.argmax+np.any and np.nonzero in these tests (gains up to ~3 orders of magnitude; advantage narrows at large sizes). Code ships as arraykit wheels and the extension works as measured.

AI-written summary · about

  1. 0:00Introduction
  2. 0:23Speaker background
  3. 1:20Numpy and performance
  4. 3:06Finding the first true
  5. 5:58Performance benchmarks
  6. 7:21C extension strategy
  7. 8:52Building a C extension
  8. 10:42Working with PyObjects
  9. 13:50Direct C type pointer access
  10. 15:57Npy_iter evaluation
  11. 18:20Contiguous memory access
  12. 20:40SIMD and loop unrolling
  13. 24:05Final optimization and results
  14. 27:08Q&A session
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.