IntersectMBO / IntersectMBO/plutus
Improve UPLC CSE performance.
- Dominant language
- Haskell
- Stars
- 1.6k
- Forks
- 508
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 22
Description
During [the investigation](https://github.com/IntersectMBO/plutus-private/issues/1425) of slow compilation of RSNARKs prototype project CSE was identified as a bottleneck.
Here are some ideas on how to improve its performance:
- The CSE transformation in UPLC [operates on an approximate builtin function arity information](https://github.com/IntersectMBO/plutus/blob/master/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs#L44-L47). It makes a [separate pass collecting builtin arities](https://github.com/IntersectMBO/plutus/blob/master/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs#L63-L64). The idea is to avoid this pass relying on statically known builtin function arity information instead.
- Improve `isAncestorOrSelf` (uses `isSuffixOf` currently)
- Avoiding Unnecessary Traversals: The algorithm traverses the AST multiple times, and some operations may be redundant. Use a single pass transformation instead of multiple traversals.
Contributor guide
Assessment
This issue has not been assessed yet.