parallel stream

A stream that splits its work across several threads from the common pool, which can speed up large computations and slow down small ones.

In more detail

Splitting, coordinating and combining results all cost time, so a small list is often faster sequentially. Callbacks must be safe to run concurrently, and blocking calls to databases or remote services do not belong there. Measure before choosing parallel; sequential is the right default for request code.

Related terms

Taught in

References

Certification courses