~/talk

The Loop War: Iterators vs. Traditional Loop

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

Benchmarks claim the classic for/type-switch approach runs about 300× faster on a 1,000 million-item test while iterators from the iter package (Go 1.23) enable lazy evaluation and easy early termination via a sequence signature like func(string) bool (yield returns a bool). Iterators avoid loading whole slices but incur boxing/unboxing and extra allocations (example: a sorting example shows around 57 allocations versus one allocation for the slice sort), so trade performance for memory and control.

AI-written summary · about

  1. 0:00Introduction and career path
  2. 1:35Focusing on the people in tech
  3. 4:07Generics versus type switches
  4. 6:58Iterator-based log processing
  5. 16:32Sorting performance showdown
  6. 19:05Conclusion on tool selection
~/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.