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

Optimization: chain of application to Case Constr #6823

Open
SeungheonOh opened this issue Feb 5, 2025 · 1 comment
Open

Optimization: chain of application to Case Constr #6823

SeungheonOh opened this issue Feb 5, 2025 · 1 comment

Comments

@SeungheonOh
Copy link
Contributor

Describe the feature you'd like

(((\a b c -> a + b + c) 10) 20) 30 is more expensive than (case (constr 0 [10, 20, 30]) f) given we apply more than 3 arguments, so we can have transform that converts chained applications into this form.

This is one way of implementing it, but this could be simpler since this deals with some other stuff as well.
https://github.com/Plutonomicon/plutarch-plutus/blob/fd7d1c1fc173542f952f19272554027183659dd6/Plutarch/Internal/Term.hs#L705-L723

Describe alternatives you've considered

I read somewhere ApplyN is planned, so once we have that this will be outdated. Though, I think this transformer is simple and good to have enough till than.

@github-actions github-actions bot added the status: needs triage GH issues that requires triage label Feb 5, 2025
@ramsay-t ramsay-t added status: triaged optimization and removed status: needs triage GH issues that requires triage labels Feb 10, 2025
@effectfully
Copy link
Contributor

Should do that indeed. Optimizations are generally low priority, so I'm marking this issue as such. Thank you for opening it.

@effectfully effectfully added Low priority Doesn't require immediate attention Untyped Plutus Core labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants