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
SPLIT-SEQUENCE is quadratic on lists #9
Comments
Example with linear growth in data size:
|
Hi Michał, that's a very good finding. Can you turn it into a patch ? |
Yes, I will be working on it today. From what I already see, this requires that I write a separate version of |
This was referenced Dec 22, 2018
Merged
Same test on #13 gives me an insane speedup:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SPLIT-SEQUENCE
internally usesSUBSEQ
insideLOOP
. This means that looping over long lists will exhibit quadratic time complexity.This is not necessary as lists can be traversed only once - naturally if splitting is done from start, and (optionally) with REVERSE and NREVERSE if splitting is done
FROM-END
. This allows for linear-time splitting on lists. See the following code for a very simple demonstration of that algorithm:The text was updated successfully, but these errors were encountered: