Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] ESQL: Speed type error testing (#119678) #119762

Merged
merged 4 commits into from
Jan 8, 2025

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Jan 8, 2025

Backports the following commits to 8.x:

This shaves a few minutes off of the ESQL build:
```
14m 50s -> 12m 38s
```

It does so by moving the type error testing from parameterized tests to
a single, stand alone test per scalar that checks the errors for all
unsupported types. It gets the list from the parameterized tests the
same way as we were doing. But it's *fast*.
AND, this will let us test a huge number of combinations without nearly
as much overhead as we had before.

In the worse case, unary math functions, this doesn't save any time.
Maybe .1 second per function. For binary math functions it saves a
*little* time. About a second per function.

But for non-math, multivalued functions: wow. IpPrefix is ternary and
it's test goes from 56.8 seconds to 2.6 seconds! Here are a few examples.

|        name        | before |    after     | before| after |
| -----------------: | -----: | -----------: | ----: | ----: |
|                Sin |   2.6s |         2.5s |   400 |   291 |
|              ATan2 |  17.4s |        16.1s |  8270 |  5961 |
|           IpPrefix |  56.8s |  🎉 2.6s | 40650 |   191 |
|             Equals |  69.9s |        50.6s | 30130 | 28131 |
|          NotEquals |  67.1s |        46.8s | 30100 | 28101 |
|        GreaterThan |  63.7s |        57.8s | 29940 | 27791 |
| GreaterThanOrEqual |  61.1s |        61.6s | 29940 | 27791 |
|           LessThan |  63.7s |        61.3s | 29940 | 27791 |
|    LessThanOrEqual |  61.1s |        59.8s | 29940 | 27791 |
|               Case | 115.3s | 🎉 45.1s | 63756 | 13236 |
|           DateDiff |   3.4s |         4.0s?|   507 |   271 |
|        DateExtract |  12.1s |         3.4s |  3406 |   156 |
|         DateFormat |   8.1s |         2.4s |  2849 |   100 |
|          DateParse |  10.6s |         2.8s |  2992 |   276 |
|          DateTrunc |  10.9s |         3.4s |  3320 |   790 |
|         ByteLength |   5.7s |         4.0s |   520 |   391 |
|           EndsWith |  13.7s |         7.2s |  3880 |  1411 |
|               Hash |  30.7s |        17.4s |  3980 |  1511 |
|              LTrim |  27.1s |        29.0s?|  2840 |  2711|
|             Locate |  85.3s | 🎉 10.3s | 44310 |  1461 |
|            Replace |  96.5s | 🎉 10.1s | 42010 |  1711 |
|              RTrim |  15.6s |        20.0s?|  2840 |  2711 |
|              Split |   6.6s |         4.0s |  3360 |   397 |
|         StartsWith |   5.5s |  🎉 0.7s |  2800 |   330 |
|          Substring | 115.2s |  🎉 2.7s | 85386 |   483 |
|               Trim |  17.4s |        17.8s |  2840 |  2710 |

Gradle Enterprise is also not happy with the raw *number* of tests ESQL
runs. So lowering the overall number is important. See the table above.
This strategy is *super* effective for that. It takes us
```
769459 -> 470429
```
@nik9000 nik9000 added :Analytics/ES|QL AKA ESQL >test Issues or PRs that are addressing/adding tests auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Jan 8, 2025
@elasticsearchmachine elasticsearchmachine merged commit 561e50c into elastic:8.x Jan 8, 2025
15 checks passed
@nik9000 nik9000 deleted the backport/8.x/pr-119678 branch January 8, 2025 19:01
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-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.18.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants