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] Update 'BuiltinRuntime' to store the costing function strictly #4496

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

effectfully
Copy link
Contributor

@effectfully effectfully commented Mar 23, 2022

Since the HOAS evaluator is gone, we don't need that laziness anymore.

@effectfully
Copy link
Contributor Author

/benchmark plutus-benchmark:validation

@iohk-devops
Copy link

Comparing benchmark results of 'plutus-benchmark:validation' on '4c619351b' (base) and 'c8351e0fb' (PR)

Script 4c61935 c8351e0 Change
auction_1-1 241.7 μs 233.6 μs -3.4%
auction_1-2 882.0 μs 863.5 μs -2.1%
auction_1-3 870.4 μs 858.7 μs -1.3%
auction_1-4 313.1 μs 304.3 μs -2.8%
auction_2-1 242.7 μs 235.1 μs -3.1%
auction_2-2 879.1 μs 869.5 μs -1.1%
auction_2-3 1.114 ms 1.104 ms -0.9%
auction_2-4 872.0 μs 856.7 μs -1.8%
auction_2-5 313.4 μs 303.7 μs -3.1%
crowdfunding-success-1 284.0 μs 274.1 μs -3.5%
crowdfunding-success-2 283.9 μs 273.2 μs -3.8%
crowdfunding-success-3 283.3 μs 274.2 μs -3.2%
currency-1 332.8 μs 328.3 μs -1.4%
escrow-redeem_1-1 485.3 μs 470.3 μs -3.1%
escrow-redeem_1-2 483.6 μs 469.5 μs -2.9%
escrow-redeem_2-1 568.2 μs 553.1 μs -2.7%
escrow-redeem_2-2 567.8 μs 552.2 μs -2.7%
escrow-redeem_2-3 566.6 μs 552.5 μs -2.5%
escrow-refund-1 213.0 μs 204.5 μs -4.0%
future-increase-margin-1 334.9 μs 327.0 μs -2.4%
future-increase-margin-2 751.1 μs 734.3 μs -2.2%
future-increase-margin-3 750.4 μs 732.8 μs -2.3%
future-increase-margin-4 695.7 μs 681.5 μs -2.0%
future-increase-margin-5 1.072 ms 1.064 ms -0.7%
future-pay-out-1 333.6 μs 327.1 μs -1.9%
future-pay-out-2 748.7 μs 731.9 μs -2.2%
future-pay-out-3 747.8 μs 729.4 μs -2.5%
future-pay-out-4 1.072 ms 1.056 ms -1.5%
future-settle-early-1 332.7 μs 326.5 μs -1.9%
future-settle-early-2 746.5 μs 732.4 μs -1.9%
future-settle-early-3 746.7 μs 732.4 μs -1.9%
future-settle-early-4 825.4 μs 812.4 μs -1.6%
game-sm-success_1-1 546.6 μs 531.0 μs -2.9%
game-sm-success_1-2 267.6 μs 255.1 μs -4.7%
game-sm-success_1-3 869.8 μs 856.6 μs -1.5%
game-sm-success_1-4 312.0 μs 300.7 μs -3.6%
game-sm-success_2-1 543.8 μs 531.4 μs -2.3%
game-sm-success_2-2 267.6 μs 256.6 μs -4.1%
game-sm-success_2-3 872.5 μs 860.4 μs -1.4%
game-sm-success_2-4 313.9 μs 301.8 μs -3.9%
game-sm-success_2-5 874.6 μs 862.5 μs -1.4%
game-sm-success_2-6 313.0 μs 301.5 μs -3.7%
multisig-sm-1 556.6 μs 544.7 μs -2.1%
multisig-sm-2 543.0 μs 532.1 μs -2.0%
multisig-sm-3 549.5 μs 536.3 μs -2.4%
multisig-sm-4 555.6 μs 540.2 μs -2.8%
multisig-sm-5 769.4 μs 757.7 μs -1.5%
multisig-sm-6 554.8 μs 541.8 μs -2.3%
multisig-sm-7 542.2 μs 530.2 μs -2.2%
multisig-sm-8 548.1 μs 536.5 μs -2.1%
multisig-sm-9 556.1 μs 538.9 μs -3.1%
multisig-sm-10 770.3 μs 756.2 μs -1.8%
ping-pong-1 457.7 μs 445.4 μs -2.7%
ping-pong-2 457.9 μs 446.4 μs -2.5%
ping-pong_2-1 271.7 μs 265.9 μs -2.1%
prism-1 221.8 μs 214.2 μs -3.4%
prism-2 591.4 μs 576.6 μs -2.5%
prism-3 502.8 μs 488.0 μs -2.9%
pubkey-1 189.5 μs 182.7 μs -3.6%
stablecoin_1-1 1.217 ms 1.184 ms -2.7%
stablecoin_1-2 262.2 μs 250.7 μs -4.4%
stablecoin_1-3 1.386 ms 1.348 ms -2.7%
stablecoin_1-4 277.9 μs 267.2 μs -3.9%
stablecoin_1-5 1.753 ms 1.696 ms -3.3%
stablecoin_1-6 345.4 μs 330.9 μs -4.2%
stablecoin_2-1 1.211 ms 1.184 ms -2.2%
stablecoin_2-2 261.5 μs 250.4 μs -4.2%
stablecoin_2-3 1.383 ms 1.350 ms -2.4%
stablecoin_2-4 277.3 μs 266.7 μs -3.8%
token-account-1 253.5 μs 246.9 μs -2.6%
token-account-2 448.6 μs 438.3 μs -2.3%
uniswap-1 552.1 μs 544.1 μs -1.4%
uniswap-2 300.8 μs 295.0 μs -1.9%
uniswap-3 2.231 ms 2.188 ms -1.9%
uniswap-4 460.4 μs 441.7 μs -4.1%
uniswap-5 1.552 ms 1.512 ms -2.6%
uniswap-6 438.8 μs 423.2 μs -3.6%
vesting-1 474.9 μs 465.9 μs -1.9%

@effectfully
Copy link
Contributor Author

-2.59% on average. Some free speedup right there. Thanks to @bezirg for bringing it up.

@michaelpj
Copy link
Contributor

The tests that run the CK machine fail now.

@michaelpj
Copy link
Contributor

Speedup looks good, though!

@effectfully
Copy link
Contributor Author

The tests that run the CK machine fail now.

Ah, I forgot that it wasn't doing any costing too. I'll do something about it, perhaps introduce some kind of dummy costing or whatever.

@effectfully effectfully force-pushed the effectfully/builtins/stricter-costing branch from c8351e0 to 136cd3c Compare March 23, 2022 11:21
@effectfully
Copy link
Contributor Author

The tests that run the CK machine fail now.

Ah, I forgot that it wasn't doing any costing too. I'll do something about it, perhaps introduce some kind of dummy costing or whatever.

Done.

Copy link
Contributor

@kwxm kwxm left a comment

Choose a reason for hiding this comment

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

Looks fine.

@kwxm
Copy link
Contributor

kwxm commented Mar 23, 2022

FYI I've got an issue to store actual functions for costing, rather than objects containing parameters that have to be looked up an used to calculate the cost every time (I assume) that the costing function is called. I keep getting distracted from that though.

@michaelpj michaelpj merged commit 91a36db into master Mar 23, 2022
@effectfully
Copy link
Contributor Author

FYI I've got an issue to store actual functions for costing, rather than objects containing parameters that have to be looked up an used to calculate the cost every time (I assume) that the costing function is called. I keep getting distracted from that though.

I was going to look into that too. Let me first try to optimize the existing stuff, maybe it's fine to have objects containing parameters as long as we don't need to match on them every time.

@effectfully effectfully deleted the effectfully/builtins/stricter-costing branch March 23, 2022 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants