Skip to content

Stream optimization checks #2955

@schlosna

Description

@schlosna

What happened?

Code like stream.map(foo::expensiveConversion).limit(N), stream.sorted().limit(N), or stream.filter(this::someFilter).sorted() does not trigger any warnings for inefficiency.

What did you want to happen?

If one writes code that limits or filters a Stream we should push those predicates earlier in the pipeline where possible to limit the amount of downstream computation and allocations are performed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions