-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Refactor and add currying optimization to uplc shrinker #770
Conversation
MicroProofs
commented
Dec 4, 2023
•
edited
Loading
edited
- Refactor optimizations so they use a uniform abstraction over the uplc tree
- Add currying to reduce duplicated applies to the same builtins
- Replace subtract integer with add integer when the second argument is a constant and flip the sign for the constant.
3385add
to
d840c94
Compare
e18d1ad
to
0cfcd78
Compare
ee13475
to
c7ee129
Compare
1caa4ee
to
537e975
Compare
b43beac
to
511af43
Compare
Gonna provide benchmarks soon. Looks like I might need to tweak the inline reducer a bit more to help reduce lambda overhead from throwing off stdlib comparisons |
511af43
to
f8eb564
Compare
2b7fc0a
to
c027021
Compare
Here are benchmarks of stdlib between main and this branch MAIN
NEW
|
I had to tweak the inliner optimization to make it a little more specialized. Using the existing one on main resulted in worse performance in all case of the std lib tests.
NEW2
In this case NEW2 represents the same branch but using the current inliner from main. |
Main branch Butane script sizes SCRIPT SIZES: [ |
Looks good just need to update snapshot tests now |
So far looks good to merge. I might tweak it to curry on builtins wtih an occurence of 3 or more to prevent the overhead, but those changes would be in another much smaller pr. Overall I'm happy with where this optimization ended up and likely this will be the last new uplc optimization for a long time. |
…and add a subtract integer to add integer conversion
bd45805
to
86c5bb8
Compare