Press "Enter" to skip to content

{ 4Comprehension } Posts

A Case Study of Implementing an Efficient Shuffling Stream/Spliterator in Java

Sorting a Stream instance is straightforward and involves just a single API method call. However, achieving the opposite is not that easy.

In this article, we’ll see how to shuffle a Stream in Java – eagerly and lazily using Stream Collectors factories, and custom Spliterators.

Leave a Comment

Kotlin Collections API Performance Antipatterns

Kotlin’s Collections API is expressive and rich – but with great power comes great responsibility – there are certain practices that can cause an unnecessary time-complexity and object allocation overhead.

To fully understand the context, make sure to check the previous article first:

Kotlin: Beware of Java Stream API Habits

2 Comments