~/talk

Deep Dive into Kotlin Sequences

Talkat droidcon Americas 2020 · 2020-11-16..11-17· [kotlin]
speakerdeck:physphil
slides:none on file

Converts a 30,000-item list to a sequence with asSequence()/toList() and runs filter→map→take lazily, cutting work from about 32,000 → 39 operations by avoiding intermediate collections and using short-circuiting. Sequences execute the whole operator chain per element and require a terminal operator to produce results. Use sequences when you have many items, many stateless ops, or can stop early; prefer collections for small sets or stateful ops like distinct. Measure with Kotlin’s measureTimeMillis to confirm gains.

AI-written summary · about

  1. 0:00Introduction to Kotlin Sequences
  2. 1:19What is a Kotlin Sequence
  3. 3:04Example with collections
  4. 5:13Switching to sequences
  5. 6:15How sequences process data
  6. 8:22Lazy vs eager execution
  7. 10:48Terminal vs intermediate operators
  8. 13:37Creating sequences
  9. 15:01When to use sequences
  10. 18:13Resources and summary
  11. 18:56Q&A
~/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.