bruno-roustant 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_r383154138
##########
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:
Lazy create structures (WildcardQuery may not have a first single-path
state), and only one visited.add() call. This speeds up mainly WildcardQuery (a
couple % in my luceneutil measures).
----------------------------------------------------------------
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]