nfsantos commented on code in PR #2108:
URL: https://github.com/apache/jackrabbit-oak/pull/2108#discussion_r1975176179
##########
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/IndexDefinition.java:
##########
@@ -1302,16 +1307,16 @@ public boolean isBasedOnNtBase() {
return JcrConstants.NT_BASE.equals(baseNodeType);
}
- private Map<String, PropertyDefinition> collectPropConfigs(NodeState
config,
-
List<NamePattern> patterns,
-
List<Aggregate.Include> propAggregate,
-
List<PropertyDefinition> nonExistentProperties,
-
List<PropertyDefinition> existentProperties,
-
List<PropertyDefinition> nodeScopeAnalyzedProps,
-
List<PropertyDefinition> functionRestrictions,
-
List<PropertyDefinition> syncProps,
-
List<PropertyDefinition> similarityProperties) {
- Map<String, PropertyDefinition> propDefns = new HashMap<>();
+ private TreeMap<String, PropertyDefinition>
collectPropConfigs(NodeState config,
+
List<NamePattern> patterns,
+
List<Aggregate.Include> propAggregate,
+
List<PropertyDefinition> nonExistentProperties,
+
List<PropertyDefinition> existentProperties,
+
List<PropertyDefinition> nodeScopeAnalyzedProps,
+
List<PropertyDefinition> functionRestrictions,
+
List<PropertyDefinition> syncProps,
+
List<PropertyDefinition> similarityProperties) {
+ TreeMap<String, PropertyDefinition> propDefns = new
TreeMap<>(String.CASE_INSENSITIVE_ORDER);
Review Comment:
I have noticed this optimization opportunity while profiling a run of the
indexing job, where the calls to `toLowerCase()` were responsible for a
significant part of object allocation in that run, and also showed up on CPU
profiling. Property names are usually Camel case, so most of them will in fact
have to be converted to lower case as most consist of two or more logical words.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]