Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Feb 24, 2025

This adds a microbenchmark for TO_LOWER and TO_UPPER. They are quite common probably could use some optimizing.

Benchmark          (operation)  Mode  Cnt   Score   Error  Units
EvalBenchmark.run     to_lower  avgt    7  41.470 ± 4.114  ns/op
EvalBenchmark.run     to_upper  avgt    7  46.795 ± 1.725  ns/op

This adds a microbenchmark for TO_LOWER and TO_UPPER. They are quite
common probably could use some optimizing.
@nik9000 nik9000 added auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL v9.0.0 v9.1.0 labels Feb 24, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Feb 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@nik9000
Copy link
Member Author

nik9000 commented Feb 24, 2025

I haven't a clue why TO_UPPER is slower in the microbenchmark. I swapped the other and ran them and got the same result.

}
}
}
case "to_lower" -> checkBytes(operation, actual, new BytesRef[] { new BytesRef("foo"), new BytesRef("bar") });
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitty nit: wondering if it make sense extracting the BytesRef[] as it's used both in page generation and the check... though probably not. :)

Copy link
Contributor

@luigidellaquila luigidellaquila left a comment

Choose a reason for hiding this comment

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

LGTM

@nik9000 nik9000 merged commit 319e53a into elastic:main Feb 24, 2025
17 checks passed
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.0

nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Feb 24, 2025
This adds a microbenchmark for TO_LOWER and TO_UPPER. They are quite
common probably could use some optimizing.
elasticsearchmachine pushed a commit that referenced this pull request Feb 24, 2025
* ESQL: Benchmark TO_LOWER and TO_UPPER (#123268)

This adds a microbenchmark for TO_LOWER and TO_UPPER. They are quite
common probably could use some optimizing.

* update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants