Skip to content

make Expr.get_symbols_aux tail-rec#603

Merged
redianthus merged 2 commits into
formalsec:mainfrom
redianthus:tailrec
May 20, 2026
Merged

make Expr.get_symbols_aux tail-rec#603
redianthus merged 2 commits into
formalsec: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

@redianthus redianthus marked this pull request as ready for review May 19, 2026 14:01
@redianthus redianthus requested a review from a team as a code owner May 19, 2026 14:01
@redianthus
Copy link
Copy Markdown
Contributor Author

@filipeom, I think it's fine as is and we can merge.

Copy link
Copy Markdown
Member

@filipeom filipeom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@redianthus redianthus merged commit 5c5cc8e into formalsec:main May 20, 2026
10 checks passed
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