Skip to content

Introduce Predicate Utilities for always true/false use-cases#105881

Merged
original-brownbear merged 1 commit intoelastic:mainfrom
original-brownbear:cleaner-predicate
Mar 4, 2024
Merged

Introduce Predicate Utilities for always true/false use-cases#105881
original-brownbear merged 1 commit intoelastic:mainfrom
original-brownbear:cleaner-predicate

Conversation

@original-brownbear
Copy link
Copy Markdown
Contributor

Just a suggetion. I think this would save us a bit of memory here and there. We have loads of places where the always true lambdas are used with Predicate.or/and. Found this initially when looking into field caps performance where we used to heavily compose these but many spots in security and index name resolution gain from these predicates. The better toString also helps in some cases at least when debugging.

Just a suggetion. I think this would save us a bit of memory here and
there. We have loads of places where the always true lambdas are used
with `Predicate.or/and`. Found this initially when looking into field
caps performance where we used to heavily compose these but many spots
in security and index name resolution gain from these predicates.
The better toString also helps in some cases at least when debugging.
@original-brownbear original-brownbear added >non-issue :Core/Infra/Core Core issues without another label labels Mar 2, 2024
@elasticsearchmachine elasticsearchmachine added v8.14.0 Team:Core/Infra Meta label for core/infra team labels Mar 2, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Copy Markdown
Contributor

@ldematte ldematte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! But how can we make sure people knows these exists and use them?

@DaveCTurner
Copy link
Copy Markdown
Member

LGTM2; I just introduced one more in org.elasticsearch.action.admin.cluster.snapshots.get.TransportGetSnapshotsAction.GetSnapshotsOperation#buildAfterPredicate.

@original-brownbear
Copy link
Copy Markdown
Contributor Author

Thanks you two! I'll see what I can do about documenting these things, I might have idea incoming :)

@original-brownbear original-brownbear merged commit fc8e2b7 into elastic:main Mar 4, 2024
@original-brownbear original-brownbear deleted the cleaner-predicate branch March 4, 2024 13:01
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Mar 4, 2024
DaveCTurner added a commit that referenced this pull request Mar 4, 2024
kkrik-es added a commit to kkrik-es/elasticsearch that referenced this pull request Mar 11, 2024
@original-brownbear original-brownbear restored the cleaner-predicate branch November 30, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Core/Infra/Core Core issues without another label >non-issue Team:Core/Infra Meta label for core/infra team v8.14.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants