Commit 32ff026
authored
Optimize dotCount in expanding dot parser (#135263)
This commit optimises the implementation of dotCount, in order to avoid costly walking each character. The implementation change is small, but defers to String::indexOf, which is backed by a vectorized JVM Hotspot intrinsic.
I noticed this method showing up in cpu profiles, in some cases consuming ~2% when there are even no fields with dots! After the change this mostly drops away.1 parent 3dcec80 commit 32ff026
File tree
3 files changed
+34
-4
lines changed- docs/changelog
- server/src
- main/java/org/elasticsearch/index/mapper
- test/java/org/elasticsearch/index/mapper
3 files changed
+34
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
522 | 523 | | |
523 | 524 | | |
524 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
525 | 551 | | |
526 | 552 | | |
527 | 553 | | |
| |||
0 commit comments