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

[Builtins] Use 'Either' in 'asConstant' #4397

Merged
merged 1 commit into from
Feb 12, 2022

Conversation

effectfully
Copy link
Contributor

I should've done that when I replaced the general m by Either in readKnown.

@effectfully
Copy link
Contributor Author

/benchmark plutus-benchmark:validation

@iohk-devops
Copy link

Comparing benchmark results of 'plutus-benchmark:validation' on 'e8edc836d' (base) and 'ffe8d5d4b' (PR)

Script e8edc83 ffe8d5d Change
auction_1-1 306.8 μs 296.8 μs -3.3%
auction_1-2 987.8 μs 969.4 μs -1.9%
auction_1-3 985.7 μs 965.5 μs -2.0%
auction_1-4 401.9 μs 389.2 μs -3.2%
auction_2-1 306.8 μs 298.7 μs -2.6%
auction_2-2 983.1 μs 966.9 μs -1.6%
auction_2-3 1.253 ms 1.227 ms -2.1%
auction_2-4 989.4 μs 961.7 μs -2.8%
auction_2-5 403.8 μs 388.1 μs -3.9%
crowdfunding-success-1 363.4 μs 349.7 μs -3.8%
crowdfunding-success-2 362.6 μs 351.0 μs -3.2%
crowdfunding-success-3 362.8 μs 351.0 μs -3.3%
currency-1 392.0 μs 379.5 μs -3.2%
escrow-redeem_1-1 572.3 μs 557.6 μs -2.6%
escrow-redeem_1-2 574.2 μs 556.8 μs -3.0%
escrow-redeem_2-1 668.8 μs 649.2 μs -2.9%
escrow-redeem_2-2 667.6 μs 653.9 μs -2.1%
escrow-redeem_2-3 669.5 μs 654.1 μs -2.3%
escrow-refund-1 266.9 μs 261.5 μs -2.0%
future-increase-margin-1 391.2 μs 381.7 μs -2.4%
future-increase-margin-2 867.5 μs 845.8 μs -2.5%
future-increase-margin-3 866.7 μs 844.8 μs -2.5%
future-increase-margin-4 791.3 μs 770.2 μs -2.7%
future-increase-margin-5 1.196 ms 1.169 ms -2.3%
future-pay-out-1 391.5 μs 379.9 μs -3.0%
future-pay-out-2 868.3 μs 842.6 μs -3.0%
future-pay-out-3 867.3 μs 846.2 μs -2.4%
future-pay-out-4 1.191 ms 1.172 ms -1.6%
future-settle-early-1 391.8 μs 380.7 μs -2.8%
future-settle-early-2 869.9 μs 844.4 μs -2.9%
future-settle-early-3 868.3 μs 843.7 μs -2.8%
future-settle-early-4 931.7 μs 907.3 μs -2.6%
game-sm-success_1-1 639.8 μs 626.0 μs -2.2%
game-sm-success_1-2 344.3 μs 332.1 μs -3.5%
game-sm-success_1-3 1.023 ms 973.8 μs -4.8%
game-sm-success_1-4 403.4 μs 385.8 μs -4.4%
game-sm-success_2-1 639.4 μs 625.7 μs -2.1%
game-sm-success_2-2 344.8 μs 330.8 μs -4.1%
game-sm-success_2-3 994.9 μs 970.6 μs -2.4%
game-sm-success_2-4 401.8 μs 385.0 μs -4.2%
game-sm-success_2-5 992.6 μs 968.4 μs -2.4%
game-sm-success_2-6 400.7 μs 383.6 μs -4.3%
multisig-sm-1 639.6 μs 626.6 μs -2.0%
multisig-sm-2 625.6 μs 614.6 μs -1.8%
multisig-sm-3 632.4 μs 622.3 μs -1.6%
multisig-sm-4 642.8 μs 627.5 μs -2.4%
multisig-sm-5 874.7 μs 851.5 μs -2.7%
multisig-sm-6 640.5 μs 629.1 μs -1.8%
multisig-sm-7 626.3 μs 617.7 μs -1.4%
multisig-sm-8 634.9 μs 623.6 μs -1.8%
multisig-sm-9 642.0 μs 632.6 μs -1.5%
multisig-sm-10 871.3 μs 857.6 μs -1.6%
ping-pong-1 532.1 μs 520.0 μs -2.3%
ping-pong-2 532.3 μs 521.0 μs -2.1%
ping-pong_2-1 334.6 μs 322.1 μs -3.7%
prism-1 286.8 μs 275.4 μs -4.0%
prism-2 693.0 μs 672.0 μs -3.0%
prism-3 599.3 μs 579.8 μs -3.3%
pubkey-1 243.9 μs 233.7 μs -4.2%
stablecoin_1-1 1.394 ms 1.366 ms -2.0%
stablecoin_1-2 334.7 μs 322.2 μs -3.7%
stablecoin_1-3 1.601 ms 1.570 ms -1.9%
stablecoin_1-4 357.4 μs 343.2 μs -4.0%
stablecoin_1-5 2.055 ms 2.020 ms -1.7%
stablecoin_1-6 443.4 μs 425.5 μs -4.0%
stablecoin_2-1 1.393 ms 1.365 ms -2.0%
stablecoin_2-2 335.7 μs 320.8 μs -4.4%
stablecoin_2-3 1.610 ms 1.570 ms -2.5%
stablecoin_2-4 357.9 μs 342.3 μs -4.4%
token-account-1 307.2 μs 298.0 μs -3.0%
token-account-2 536.3 μs 519.1 μs -3.2%
uniswap-1 629.0 μs 613.8 μs -2.4%
uniswap-2 368.3 μs 357.8 μs -2.9%
uniswap-3 2.637 ms 2.591 ms -1.7%
uniswap-4 584.2 μs 567.0 μs -2.9%
uniswap-5 1.848 ms 1.818 ms -1.6%
uniswap-6 556.2 μs 540.5 μs -2.8%
vesting-1 549.9 μs 536.0 μs -2.5%

@effectfully
Copy link
Contributor Author

This is crazy.

@effectfully effectfully force-pushed the effectfully/builtins/Either-in-asConstant branch from ffe8d5d to 0484954 Compare February 12, 2022 20:50
@effectfully
Copy link
Contributor Author

effectfully commented Feb 12, 2022

It does make some sense: asConstant never gets inlined currently and mtl-style is expensive in that case. 2-4% speedup is unexpected though.

Merging without a review, 'cause the change is completely trivial and clearly beneficial.

@effectfully effectfully merged commit afe6dcd into master Feb 12, 2022
@effectfully effectfully deleted the effectfully/builtins/Either-in-asConstant branch February 12, 2022 21:26
effectfully added a commit that referenced this pull request Feb 13, 2022
Copy link
Contributor

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

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

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants