Youssef Shoaib [MOD]
07/08/2025, 9:51 PMval continued = when {
collector.has(Characteristics.CONCURRENT, Characteristics.UNORDERED) ->
started.parMapUnordered(concurrency) { collector.accumulate(accumulator, it) }
collector.has(Characteristics.CONCURRENT) ->
started.parMap(concurrency) { collector.accumulate(accumulator, it) }
else -> started.map { collector.accumulate(accumulator, it) }
Specifically, parMap
. From looking at its code, it seems that it's only ordered in the results that it produces (which are all Unit
in this case), but the mapping itself happens in the same exact way as parMapUnordered
. It thus seems unnecessarily expensive