-
Notifications
You must be signed in to change notification settings - Fork 159
Description
We often write statements like: factory.forEach(Shift.class).filter(someCondition)
where someCondition
only uses data that never changes (static).
Whenever a shift
changes in the example above, the filter is evaluated. Running this evaluation often (over and over) is costly.
Instead of evaluating the filter every time a shift
changes, I propose to cache the filtered list of shifts
.
We have worked around this issue by introducing a new type, for which we precompute the filtering and use that instead of the original Shift.class
.
Another positiv effect of providing something like filterStatic
and describing the difference to filter
may be that it may make the behavior of filter
even more clear.
ge0ffrey
Metadata
Metadata
Assignees
Labels
No labels