Streams is a very flexible way to process data, but it involves a lot of classes and complexity.
For Arrays.stream, we are always doing the exact same fixed size array mapping, so we don't need all the features that comes with Streams, and can just use a simple helper method.
For GTR.merge, we repeatedly concat() streams and create lots of intermediate distinct operations and array objects.
We noticed this on a profiler in our app. It does not take a ton of time, but it seems like an easy improvement.
Streams is a very flexible way to process data, but it involves a lot of classes and complexity.
For
Arrays.stream
, we are always doing the exact same fixed size array mapping, so we don't need all the features that comes with Streams, and can just use a simple helper method.For
GTR.merge
, we repeatedly concat() streams and create lots of intermediate distinct operations and array objects.We noticed this on a profiler in our app. It does not take a ton of time, but it seems like an easy improvement.