-
Notifications
You must be signed in to change notification settings - Fork 4
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
Don't use recursion #13
Comments
Here pathological example which hits a StackOverflow
This starts to happen from a stream length of about 13000 cells (or about 25000 cells without
runs just as well as the 1000x larger catchment
This is because the recursion is depth-first, I think. |
Note that on Linux |
This is semi-addressed with 2f3776b |
There are several recursive algorithms in this package. This means that they could potentially run into Stackoverflows if the catchments and/or streams get too big. I haven't run into this yet (with max stream-length of 4k cells and max catchment size of 5e6 cells). Recursion can be re-written in terms of loops, see e.g. https://raganwald.com/2018/05/27/tail.html.
The text was updated successfully, but these errors were encountered: