-
Notifications
You must be signed in to change notification settings - Fork 687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suffix array is a bit slow #190
Comments
I'm also having trouble with this implementation; it is too slow to pass several CSES problems, such as https://cses.fi/problemset/task/1111/ or https://cses.fi/problemset/task/1110. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apparently the suffix array is a bit slow and has resulted in TLEs.
One suggestion that came up in the AC discord server (https://discord.com/channels/555883512952258563/559415184826040340/809806400070483989) is splitting
into multiple loops, e.g.
which seems to help on random data. It's not obvious why, but I'm speculating that it's due to load mispredictions.
The suffix array seems to perform worse on repetitive data though (e.g. s[i] = i % 10), and the change makes performance worse in that case. :(
The text was updated successfully, but these errors were encountered: