You need to test it with some realistic data for a benchmark.
In Commons Statistics we have a case where all elements of an array are
passed to a consumer. So you have either:
int[] a = ...
IntConsumer c = ...
Arrays.stream(a).forEach(c::accept)
vs
for (final int i : a) {
c.accept(i);
}
W
There is/was a discussion in Cassandra Dev recently about the overhead of
Java Streaming vs simple loops/iteration. The consensus there is that
streams should not be used in the hot path. Discussion then devolved into
determining hot path or banning outright.
My question is should we remove the