Commit ba4b1b2
authored
Fix inefficient org.elasticsearch.index.mapper.Mapper#getTotalFieldsCount implementations (elastic#119555) (elastic#119557)
This is eating up a lot of CPU when creating indices and visibly slowing
down many-shards benchmarks. Looking the profiling the cost of these
implementations is almost exclusively the cost of the stream abstraction
overhead (because we needlessly create the stream for every field mapper).
Keeping it simple and using iterators almost completely removes the cost
of this thing from profiling.1 parent 320fc75 commit ba4b1b2
File tree
3 files changed
+11
-4
lines changed- server/src/main/java/org/elasticsearch/index/mapper
3 files changed
+11
-4
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
| |||
444 | 443 | | |
445 | 444 | | |
446 | 445 | | |
447 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
267 | 271 | | |
268 | 272 | | |
269 | 273 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
| 541 | + | |
542 | 542 | | |
543 | 543 | | |
0 commit comments