~/talk

When to Use Native Extensions in Rust: Accessible, Safe Performance

TalkinSpanishat PyCon US 2021 · 2021-05-14..05-15· [rust]
links:none on file
slides:none on file

Use native Rust extensions when profiling shows the critical path still dominates after optimizations and concurrency testing. Rust gives near-C/C++ performance plus memory and concurrency safety, supports incremental integration without full rewrites, and a concrete example is Pants moving orchestration, caching and management of hundreds–thousands of threads/processes into a Rust extension (five years in production) that dramatically reduced latency according to profiles and flamegraphs.

AI-written summary · about

  1. 0:00Start
  2. 0:30Presentation plan
  3. 0:50Who am I
  4. 2:00Pants - how we use Rust + Python
  5. 3:22Python is usually slow
  6. 3:47But it’s not always a problem
  7. 6:02Profiling
  8. 6:35Flame graphs
  9. 6:51GIL profiles
  10. 7:19Some options when there’s a performance problem
  11. 7:32Optimizing
  12. 8:20Python’s concurrency
  13. 10:06Option 3
  14. 10:59Rewriting everything in another language
  15. 11:51Native extensions: a mix of Python and another language
  16. 12:16Extension - demo
  17. 12:46When native extensions can be worth it
  18. 13:45Why Pants chose a native extension
  19. 14:37Native extensions add complexity
  20. 15:16Some options for native extensions
  21. 16:17Rust can use Python too!
  22. 16:30C and C++ don’t have memory safety.
  23. 17:06Memory vulnerabilities are common
  24. 17:33Rust - memory safety without a garbage collector. The compiler checks memory safety via its borrow checker.
  25. 17:59Rust - fearless concurrency
  26. 18:17Rust - performance parity
  27. 18:33Rust - other advantages
  28. 19:08Rust - some disadvantages
  29. 19:39Resources on Rust
  30. 20:10Summary
  31. 20:59Follow the Pants team’s conversation
~/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.