Skip to content

Commit 8daac20

Browse files
Don't intern leafName in Mapper.Builder (elastic#119554) (elastic#119603)
We shouldn't intern in the builder already. It's redundant since we'll be interning the mapper name when we actually build the mapper instance anyway and introduces a non-trivial slowdown into mapper serialization because we create temporary builders during serialization that never turn into concrete instances.
1 parent 8555b35 commit 8daac20

File tree

1 file changed

+2
-3
lines changed
  • server/src/main/java/org/elasticsearch/index/mapper

1 file changed

+2
-3
lines changed

server/src/main/java/org/elasticsearch/index/mapper/Mapper.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,8 @@ public abstract static class Builder {
107107

108108
private String leafName;
109109

110-
@SuppressWarnings("this-escape")
111110
protected Builder(String leafName) {
112-
setLeafName(leafName);
111+
this.leafName = leafName;
113112
}
114113

115114
public final String leafName() {
@@ -120,7 +119,7 @@ public final String leafName() {
120119
public abstract Mapper build(MapperBuilderContext context);
121120

122121
void setLeafName(String leafName) {
123-
this.leafName = internFieldName(leafName);
122+
this.leafName = leafName;
124123
}
125124
}
126125

0 commit comments

Comments
 (0)