You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2023/05/15 16:07:09 UTC
[lucene] branch branch_9x updated: Update Javadoc for topoSortStates method after #12286 (#12292)
This is an automated email from the ASF dual-hosted git repository.
uschindler pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new afacf23a69d Update Javadoc for topoSortStates method after #12286 (#12292)
afacf23a69d is described below
commit afacf23a69dd1e16c0212be3898a82eabebe9b6f
Author: tang donghai <ta...@gmail.com>
AuthorDate: Tue May 16 00:06:01 2023 +0800
Update Javadoc for topoSortStates method after #12286 (#12292)
---
.../src/java/org/apache/lucene/util/automaton/Operations.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java b/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java
index a25d992e351..8dac4c65450 100644
--- a/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java
+++ b/lucene/core/src/java/org/apache/lucene/util/automaton/Operations.java
@@ -1317,6 +1317,14 @@ public final class Operations {
* non-recursive, so it will not exhaust the java stack for automaton matching long strings. If
* there are dead states in the automaton, they will be removed from the returned array.
*
+ * <p>Note: This method uses a deque to iterative the states, which could potentially consume a
+ * lot of heap space for some automatons. Specifically, automatons with a deep level of states
+ * (i.e., a large number of transitions from the initial state to the final state) may
+ * particularly contribute to high memory usage. The memory consumption of this method can be
+ * considered as O(N), where N is the depth of the automaton (the maximum number of transitions
+ * from the initial state to any state). However, as this method detects cycles, it will never
+ * attempt to use infinite RAM.
+ *
* @param a the Automaton to be sorted
* @return the topologically sorted array of state ids
*/