rmuir commented on a change in pull request #1281: LUCENE-9245: Optimize 
AutomatonTermsEnum memory and automaton Operations.getCommonPrefixBytesRef.
URL: https://github.com/apache/lucene-solr/pull/1281#discussion_r383312415
 
 

 ##########
 File path: 
lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java
 ##########
 @@ -1091,25 +1091,33 @@ public static String getCommonPrefix(Automaton a) {
    * @return common prefix, which can be an empty (length 0) BytesRef (never 
null)
    */
   public static BytesRef getCommonPrefixBytesRef(Automaton a) {
 
 Review comment:
   I don't think this is the right tradeoff. It makes the code more complex, 
saving the cost of creating a few simple ordinary objects. I hate to say i 
don't trust your benchmark, but I don't trust your benchmark represents a 
typical case here. We should keep this code simple, there are other ways it can 
be improved.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to