https://kotlinlang.org logo
#feed
Title
# feed
k

Katarzyna

09/20/2021, 7:47 AM
What is the difference between list and sequence processing, and when each should be preferred? Prefer Sequence for big collections with more than one processing step by @marcinmoskala https://kt.academy/article/ek-sequence
👍 1
e

ephemient

09/20/2021, 8:01 AM
List may be faster than Sequence for other reasons, due to inlining of most operators and the output size of some operators being known in advance (whereas if you're going to stick a
.toList()
at the end of a sequence chain, it will use the copying growth strategy of ArrayList)
☝️ 1
4 Views