~/talk

Overengineering Ruby with Native Extensions

Talkat RubyConf 2026 · 2026-07-14..07-16· [ruby, c-and-cpp]
links:none on file
slides:none on file

A Rails CSV importer parses a million rows in ~7 seconds and consumes ~1.1 GB memory with plain Ruby; building a C native extension yields 9.4x faster runtime but still high memory and observability gaps, Rust extension using the CSV crate runs ~1.22s with ~850 MB, FFI runs ~3.2s with ~620 MB, and native code requires mkMF/make, libcsv or homebrew links and Perf to profile. Switching to streaming: 5s 300 MB fixes memory crashes without leaving Ruby.

AI-written summary · about

  1. 0:00Introduction
  2. 1:30Native extensions in Ruby
  3. 4:23CSV parsing bottleneck
  4. 8:17Building and installing extensions
  5. 10:19Writing faster CSV extension
  6. 16:40Benchmarking performance
  7. 17:44Profiling native extensions
  8. 18:27C Rust and FFI comparison
  9. 20:54Trade-offs of extensions
  10. 21:38Fixing without extensions
  11. 22:42Key lessons
  12. 24:09Conclusion
~/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.