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

Benchmark the production code fully rather than some arbitrary thing #5409

Merged

Conversation

effectfully
Copy link
Contributor

This is a continuation of #5200, which updated BenchCek.hs to use the correct evaluation context. This one updates BenchFull.hs.

@effectfully
Copy link
Contributor Author

/benchmark validation-full

@github-actions
Copy link
Contributor

Click here to check the status of your benchmark.

@effectfully effectfully added the No Changelog Required Add this to skip the Changelog Check label Jun 28, 2023
@github-actions
Copy link
Contributor

Comparing benchmark results of ' validation-full' on '7f3fabd2d1' (base) and '3430c60cf4' (PR)

Results table
Script 7f3fabd 3430c60 Change
auction_1-1 428.4 μs 426.9 μs -0.4%
auction_1-2 1.690 ms 1.677 ms -0.8%
auction_1-3 1.671 ms 1.657 ms -0.8%
auction_1-4 485.6 μs 483.7 μs -0.4%
auction_2-1 427.6 μs 427.0 μs -0.1%
auction_2-2 1.679 ms 1.665 ms -0.8%
auction_2-3 1.957 ms 1.940 ms -0.9%
auction_2-4 1.659 ms 1.650 ms -0.5%
auction_2-5 488.8 μs 483.2 μs -1.1%
crowdfunding-success-1 521.0 μs 520.8 μs -0.0%
crowdfunding-success-2 520.5 μs 520.4 μs -0.0%
crowdfunding-success-3 520.1 μs 520.5 μs +0.1%
currency-1 584.0 μs 584.9 μs +0.2%
escrow-redeem_1-1 831.2 μs 832.5 μs +0.2%
escrow-redeem_1-2 833.9 μs 831.5 μs -0.3%
escrow-redeem_2-1 909.9 μs 910.3 μs +0.0%
escrow-redeem_2-2 909.6 μs 910.0 μs +0.0%
escrow-redeem_2-3 912.3 μs 909.6 μs -0.3%
escrow-refund-1 552.7 μs 551.6 μs -0.2%
future-increase-margin-1 584.3 μs 586.2 μs +0.3%
future-increase-margin-2 1.104 ms 1.106 ms +0.2%
future-increase-margin-3 1.105 ms 1.106 ms +0.1%
future-increase-margin-4 1.608 ms 1.621 ms +0.8%
future-increase-margin-5 2.152 ms 2.153 ms +0.0%
future-pay-out-1 586.6 μs 584.4 μs -0.4%
future-pay-out-2 1.105 ms 1.105 ms 0.0%
future-pay-out-3 1.104 ms 1.104 ms 0.0%
future-pay-out-4 2.140 ms 2.153 ms +0.6%
future-settle-early-1 585.4 μs 585.5 μs +0.0%
future-settle-early-2 1.103 ms 1.107 ms +0.4%
future-settle-early-3 1.103 ms 1.110 ms +0.6%
future-settle-early-4 1.800 ms 1.804 ms +0.2%
game-sm-success_1-1 1.197 ms 1.204 ms +0.6%
game-sm-success_1-2 413.2 μs 412.2 μs -0.2%
game-sm-success_1-3 1.611 ms 1.619 ms +0.5%
game-sm-success_1-4 448.0 μs 449.1 μs +0.2%
game-sm-success_2-1 1.199 ms 1.200 ms +0.1%
game-sm-success_2-2 413.5 μs 411.3 μs -0.5%
game-sm-success_2-3 1.607 ms 1.626 ms +1.2%
game-sm-success_2-4 447.2 μs 449.1 μs +0.4%
game-sm-success_2-5 1.606 ms 1.613 ms +0.4%
game-sm-success_2-6 448.1 μs 449.2 μs +0.2%
multisig-sm-1 1.303 ms 1.304 ms +0.1%
multisig-sm-2 1.276 ms 1.278 ms +0.2%
multisig-sm-3 1.293 ms 1.294 ms +0.1%
multisig-sm-4 1.297 ms 1.298 ms +0.1%
multisig-sm-5 1.569 ms 1.571 ms +0.1%
multisig-sm-6 1.302 ms 1.302 ms 0.0%
multisig-sm-7 1.275 ms 1.279 ms +0.3%
multisig-sm-8 1.296 ms 1.294 ms -0.2%
multisig-sm-9 1.301 ms 1.302 ms +0.1%
multisig-sm-10 1.579 ms 1.571 ms -0.5%
ping-pong-1 1.058 ms 1.055 ms -0.3%
ping-pong-2 1.059 ms 1.055 ms -0.4%
ping-pong_2-1 851.0 μs 850.3 μs -0.1%
prism-1 361.3 μs 364.4 μs +0.9%
prism-2 1.232 ms 1.235 ms +0.2%
prism-3 737.0 μs 739.9 μs +0.4%
pubkey-1 336.6 μs 337.4 μs +0.2%
stablecoin_1-1 2.616 ms 2.634 ms +0.7%
stablecoin_1-2 406.2 μs 405.6 μs -0.1%
stablecoin_1-3 2.830 ms 2.822 ms -0.3%
stablecoin_1-4 419.2 μs 416.8 μs -0.6%
stablecoin_1-5 3.230 ms 3.310 ms +2.5%
stablecoin_1-6 475.4 μs 474.4 μs -0.2%
stablecoin_2-1 2.619 ms 2.664 ms +1.7%
stablecoin_2-2 407.0 μs 406.0 μs -0.2%
stablecoin_2-3 2.823 ms 2.823 ms 0.0%
stablecoin_2-4 418.2 μs 416.5 μs -0.4%
token-account-1 499.8 μs 501.0 μs +0.2%
token-account-2 664.8 μs 666.7 μs +0.3%
uniswap-1 806.1 μs 809.1 μs +0.4%
uniswap-2 542.7 μs 543.4 μs +0.1%
uniswap-3 3.467 ms 3.568 ms +2.9%
uniswap-4 584.0 μs 589.9 μs +1.0%
uniswap-5 2.572 ms 2.638 ms +2.6%
uniswap-6 567.5 μs 572.8 μs +0.9%
vesting-1 856.8 μs 855.7 μs -0.1%

@effectfully effectfully force-pushed the effectfully/benchmarking/stop-the-irrelevance-in-full branch from 3430c60 to dfdc6b5 Compare June 29, 2023 01:51
@effectfully
Copy link
Contributor Author

^ yay, noise.

@effectfully effectfully requested a review from bezirg June 29, 2023 01:52
-- strictify and "short" the result cbor to create a real `SerialisedScript`
!benchScript = force . serialiseUPLC $ UPLC.Program () ver term
eval script = do
either (error . show) (\_ -> ()) . snd $ evaluateScriptRestricting
Copy link
Contributor

@bezirg bezirg Jun 29, 2023

Choose a reason for hiding this comment

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

You can use i think const () . PlutusPrelude.unsafeFromRight

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that'd return () regardless of whether we get Left or Right and we do want to throw on Left instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

oups yeah

(term, args) = peelDataArguments body
-- strictify and "short" the result cbor to create a real `SerialisedScript`
!benchScript = force . serialiseUPLC $ UPLC.Program () ver term
eval script = do
Copy link
Contributor

Choose a reason for hiding this comment

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

do looks redundant here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, thanks, fixed.

@effectfully effectfully marked this pull request as ready for review June 29, 2023 14:40
@effectfully effectfully force-pushed the effectfully/benchmarking/stop-the-irrelevance-in-full branch from dfdc6b5 to e84de84 Compare June 29, 2023 14:47
@effectfully effectfully enabled auto-merge (squash) June 29, 2023 14:58
@effectfully effectfully merged commit e32264a into master Jun 29, 2023
7 checks passed
@effectfully effectfully deleted the effectfully/benchmarking/stop-the-irrelevance-in-full branch June 29, 2023 15:11
@kwxm
Copy link
Contributor

kwxm commented Jul 4, 2023

Should we worry about this for the nofib benchmarks too? I'm getting confused because we have lots of different benchmarks that all seem to have their own ways of evaluating terms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Benchmarks bug No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants