~/talk

Billion Rows Walk Into a Go Bar

Talkat GopherCon India 2024 · 2024-11-11..11-13· [go]
links:none on file
slides:none on file

Solves the 1BRC (one billion-line) input by profiling with pprof, iterating from a 2m27s prototype down to ~10s and cutting memory from gigabytes to tiny by specific changes: switch scanner.text→scanner.Bytes→custom byte parser, replace bytes.Split with index-based loop, batch lines and use buffered channels, match workers to CPU cores, tune buffer size (sweet spot ~1MB), use setGCPercent and unsafe string zero-copy to avoid huge allocations — concrete code edits and numbers instead of abstract advice.

AI-written summary · about

  1. 0:00Introduction and speaker background
  2. 1:04Introducing the 1BRC challenge
  3. 2:28Why performance matters in development
  4. 3:31Initial profiling and unexpected findings
  5. 5:37Optimizing file reading with byte arrays
  6. 7:42Custom parser for temperature processing
  7. 9:48Reducing memory allocations in parsing
  8. 11:14Replacing built-in functions with loops
  9. 12:56Parallel processing and its pitfalls
  10. 14:20Batch reading and handling line breaks
  11. 16:29Buffer size trade-offs in reading
  12. 17:32Parallelizing with multiple workers
  13. 19:18External factors affecting performance
  14. 20:00Garbage collection tuning
  15. 21:04Zero-copy string conversion
  16. 22:30Key lessons from the challenge
  17. 23:12Further optimizations and resources
  18. 23:53Q&A session
~/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.