Hi all,
Sorry for re-surfacing this.
As part of a Kiama 2.1 -> Kiama 2.4 migration, we removed some performance-related patches that we had put in place.
These focused on a few areas. For instance:
- reducing object creation by removing the use immutable structures for queues and stacks (e.g. TreeRelation set)
- avoiding the NonLocalControlReturn exception, which is used by Scala when doing a return inside a closure (e.g. TreeRelation isLeaf, allProduct, allTraversable, etc). Code is rewritten to use while loops essentially.
At the time, these made a visible difference, particularly when dealing with larger ASTs. I do recall NonLocalControlReturn exception consuming significant CPU time for instance.
Admittedly, there is some hope that newer scalac's do a better job at these, although they are likely still an issue.
We haven't isolated a benchmark; but before we consider embarking on that, and perhaps attempting some PRs upstream, I'd like to ask if anyone has looked at similar-ish performance issues?
Thanks!