https://kotlinlang.org logo
Title
d

demonwav

02/11/2018, 1:39 AM
How comparable is performance of Kotlin sequences vs Java streams? I'd like to prefer one or the other for consistency, and I usually go with sequences, as it looks more similar to the non-lazy API, good for single operations, and I find it's more flexible than streams. but is there a downside to using sequences over streams?
a

Andreas Sinz

02/11/2018, 8:44 AM
They are very similar. I'm not aware of any big downsides of Sequences compared to Streams
c

Czar

02/11/2018, 9:16 AM
Kotlin sequences do not have parallel operation option. Although you can still do it with co-routines, it'll be more verbose than Java Streams. No idea about performance, I haven't tested.