Skip to content

make Expr.get_symbols_aux tail-rec#603

Draft
redianthus wants to merge 1 commit intoformalsec:mainfrom
redianthus:tailrec
Draft

make Expr.get_symbols_aux tail-rec#603
redianthus wants to merge 1 commit intoformalsec:mainfrom
redianthus:tailrec

Conversation

@redianthus
Copy link
Copy Markdown
Contributor

This is an experiment. This function is appearing too much in the profiling results to my taste. I made it tail-recursive by CPS transformation. I hope that TCO will reduce its cost.

If it does not fix the issue, I might go into defunctionalization. The code will likely be less readable so I'd like to try this one first. 😅

@filipeom
Copy link
Copy Markdown
Member

What about memoizing the result of the function as well? It could help I think

@redianthus
Copy link
Copy Markdown
Contributor Author

Ah yes indeed, it's likely going to help too! :)
Will try that too

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 this pull request may close these issues.

2 participants