Performance

Both McCreight’s and Ukkonen’s algorithms build the suffix tree in \(\mathcal O(\lvert S\rvert)\) time, with \(\lvert S\rvert\) being the length of the input sequence. This may not be strictly true for this implementation, especially for large alphabets, since the library uses Python dictionaries to store symbols and those dictionaries are not linear.

Python 3.10.7

_images/graph_time_complexity.png

PyPy 7.3.9

_images/graph_time_complexity_pypy38.png