Skip to content
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

Non-tail recursive Hashtable find_all function #8676

Closed
aschahar opened this issue May 16, 2019 · 6 comments · Fixed by #11354
Closed

Non-tail recursive Hashtable find_all function #8676

aschahar opened this issue May 16, 2019 · 6 comments · Fixed by #11354

Comments

@aschahar
Copy link

aschahar commented May 16, 2019

The Hashtbl.find_all function implementation is not tail recursive. Due to this, stack overflow occurs for a big set of the data.

@gasche
Copy link
Member

gasche commented May 16, 2019

See #4747 for previous work on making Hashtbl functions tail-recursive. It's a lot of subtle work that generally degrades the performance of the use-cases most users care about. Personally I decided to wait until tail-recursion-modulo-cons is available in the compiler (see #181), which would let us write not-unnatural tail-recursive code.

@wizeman
Copy link

wizeman commented Nov 18, 2019

Perhaps a warning could be added to the documentation in the mean time? Otherwise, non-experts might run into unpleasant surprises...
The List module seems to have functions flagged as non-tail recursive...

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Nov 20, 2020
@gasche
Copy link
Member

gasche commented Nov 20, 2020

We made some progress on tail-modulo-cons optimizations ( #9760 ); if one of the implements would get merged, we would have an easy way to make this function tail-recursive without noticeable performance loss.

@github-actions github-actions bot removed the Stale label Nov 23, 2020
@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label Nov 26, 2021
@gasche gasche reopened this Dec 29, 2021
@gasche
Copy link
Member

gasche commented Dec 29, 2021

Reopening: it should be easy, now that TRMC has been integrated, to make find_all tail-recursive, but this will have to wait for 5.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants