nfsantos commented on code in PR #1616:
URL: https://github.com/apache/jackrabbit-oak/pull/1616#discussion_r1703998208


##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/SortKey.java:
##########
@@ -60,8 +59,9 @@ public static String[] genSortKeyPathElements(String path) {
             // Interning these strings should provide a big reduction in 
memory usage.
             // It is not worth to intern all levels because at lower levels 
the names are more likely to be less diverse,
             // often even unique, so interning them would fill up the interned 
string hashtable with useless entries.
-            if (i < 3 || part.length() == 1 || 
COMMON_PATH_WORDS.contains(part)) {
-                pathElements[i] = part.intern();
+            if ((i < 3 || part.length() == 1 || part.startsWith("dam:") || 
part.startsWith("jcr:") || COMMON_PATH_WORDS.contains(part)) &&

Review Comment:
   I removed the reference to `dam:`. For the time being, I will not make the 
list of strings to be checked configurable, as this would be a bigger change. 
The main goal of PR is to avoid an expensive call to `String.intern()` every 
time we parse line, so we can leave further optimizations for future work, if 
that is deemed necessary.



-- 
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]

Reply via email to