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

Kwxm/uplc-criterion #5755

Merged
merged 9 commits into from
Feb 6, 2024
Merged

Kwxm/uplc-criterion #5755

merged 9 commits into from
Feb 6, 2024

Conversation

kwxm
Copy link
Contributor

@kwxm kwxm commented Jan 31, 2024

The uplc executable had a -x option that let you measure the execution time of a script. That didn't give good results, so here I've replaced it with a benchmark command that runs a Criterion benchmark instead. This gives much better results, but they're not directly comparable with the validation benchmarks in plutus-benchmark: see the attached comparison. In general the benchmarks here are maybe 15-20% faster than the ones in plutus-benchmark (but see multisig-sm 2, 5, 6, and 10!). I think the difference is probably due to all the extra stuff that evaluateCekLikeInProd has to do: I pasted all of the extra code into uplc and the results mostly seemed to at least be in the same ballpark: I'll try that again with the final version. There also seems to be some inverse correlation between the difference of the two sets of results and the size of the script (ie, the bigger the script, the smaller the difference between the uplc results and the plutus-benchmark ones).

Script                        plutus-benchmark     uplc        Change
------------------------------------------------------------------------
auction_1-1                       215.7 μs	 184.5 μs     -14.5%
auction_1-2                       848.4 μs	 725.1 μs     -14.5%
auction_1-3                       839.1 μs	 718.9 μs     -14.3%
auction_1-4                       291.5 μs	 239.0 μs     -18.0%
auction_2-1                       224.6 μs	 185.0 μs     -17.6%
auction_2-2                       844.6 μs	 726.8 μs     -13.9%
auction_2-3                       1.097 ms	 959.9 μs     -12.5%
auction_2-4                       837.9 μs	 717.9 μs     -14.3%
auction_2-5                       289.9 μs	 237.8 μs     -18.0%
crowdfunding-success-1            264.4 μs	 217.3 μs     -17.8%
crowdfunding-success-2            264.1 μs	 217.1 μs     -17.8%
crowdfunding-success-3            265.1 μs	 217.1 μs     -18.1%
currency-1                        321.5 μs	 272.9 μs     -15.1%
escrow-redeem_1-1                 448.0 μs	 375.1 μs     -16.3%
escrow-redeem_1-2                 453.6 μs	 375.4 μs     -17.2%
escrow-redeem_2-1                 518.1 μs	 441.5 μs     -14.8%
escrow-redeem_2-2                 518.8 μs	 439.1 μs     -15.4%
escrow-redeem_2-3                 517.8 μs	 441.6 μs     -14.7%
escrow-refund-1                   195.5 μs	 161.7 μs     -17.3%
future-increase-margin-1          322.3 μs	 274.8 μs     -14.7%
future-increase-margin-2          698.1 μs	 599.0 μs     -14.2%
future-increase-margin-3          700.0 μs	 599.6 μs     -14.3%
future-increase-margin-4          652.0 μs	 549.0 μs     -15.8%
future-increase-margin-5          1.109 ms	 1.039 ms      -6.3%
future-pay-out-1                  322.0 μs	 273.8 μs     -15.0%
future-pay-out-2                  694.7 μs	 596.2 μs     -14.2%
future-pay-out-3                  694.8 μs	 599.3 μs     -13.7%
future-pay-out-4                  1.108 ms	 1.032 ms      -6.9%
future-settle-early-1             320.7 μs	 275.3 μs     -14.2%
future-settle-early-2             699.6 μs	 597.8 μs     -14.6%
future-settle-early-3             697.4 μs	 598.7 μs     -14.2%
future-settle-early-4             812.7 μs	 772.2 μs      -5.0%
game-sm-success_1-1               495.1 μs	 425.9 μs     -14.0%
game-sm-success_1-2               250.2 μs	 205.0 μs     -18.1%
game-sm-success_1-3               847.3 μs	 755.2 μs     -10.9%
game-sm-success_1-4               284.8 μs	 230.4 μs     -19.1%
game-sm-success_2-1               499.1 μs	 425.7 μs     -14.7%
game-sm-success_2-2               251.8 μs	 205.0 μs     -18.6%
game-sm-success_2-3               848.1 μs	 749.2 μs     -11.7%
game-sm-success_2-4               284.1 μs	 230.3 μs     -18.9%
game-sm-success_2-5               848.9 μs	 759.7 μs     -10.5%
game-sm-success_2-6               285.2 μs	 231.2 μs     -18.9%
multisig-sm-1                     513.7 μs	 438.7 μs     -14.6%
multisig-sm-2                     499.4 μs	 624.0 μs     +24.9%
multisig-sm-3                     509.0 μs	 421.6 μs     -17.2%
multisig-sm-4                     510.6 μs	 428.4 μs     -16.1%
multisig-sm-5                     738.0 μs	 433.3 μs     -41.3%
multisig-sm-6                     512.4 μs	 628.5 μs     +22.7%
multisig-sm-7                     498.6 μs	 438.2 μs     -12.1%
multisig-sm-8                     502.7 μs	 422.0 μs     -16.1%
multisig-sm-9                     510.7 μs	 428.1 μs     -16.2%
multisig-sm-10                    733.9 μs	 431.8 μs     -41.2%
ping-pong-1                       420.8 μs	 356.8 μs     -15.2%
ping-pong-2                       421.9 μs	 356.1 μs     -15.6%
ping-pong_2-1                     255.1 μs	 210.5 μs     -17.5%
prism-1                           210.5 μs	 169.4 μs     -19.5%
prism-2                           535.7 μs	 451.7 μs     -15.7%
prism-3                           470.1 μs	 398.9 μs     -15.1%
pubkey-1                          177.7 μs	 143.2 μs     -19.4%
stablecoin_1-1                    1.222 ms	 1.167 ms      -4.5%
stablecoin_1-2                    245.2 μs	 198.3 μs     -19.1%
stablecoin_1-3                    1.421 ms	 1.344 ms      -5.4%
stablecoin_1-4                    261.4 μs	 211.5 μs     -19.1%
stablecoin_1-5                    1.855 ms	 1.714 ms      -7.6%
stablecoin_1-6                    321.7 μs	 258.9 μs     -19.5%
stablecoin_2-1                    1.222 ms	 1.167 ms      -4.5%
stablecoin_2-2                    244.7 μs	 198.5 μs     -18.9%
stablecoin_2-3                    1.423 ms	 1.342 ms      -5.7%
stablecoin_2-4                    259.8 μs	 211.9 μs     -18.4%
token-account-1                   242.9 μs	 203.0 μs     -16.4%
token-account-2                   427.2 μs	 361.2 μs     -15.4%
uniswap-1                         533.0 μs	 458.2 μs     -14.0%
uniswap-2                         283.4 μs	 240.0 μs     -15.3%
uniswap-3                         2.377 ms	 2.189 ms      -7.9%
uniswap-4                         421.8 μs	 345.9 μs     -18.0%
uniswap-5                         1.539 ms	 1.427 ms      -7.3%
uniswap-6                         400.5 μs	 330.5 μs     -17.5%
vesting-1                         447.1 μs	 383.8 μs     -14.2%

@kwxm kwxm added the No Changelog Required Add this to skip the Changelog Check label Jan 31, 2024
@@ -268,64 +292,72 @@ runApplyToData (ApplyOptions inputfiles ifmt outp ofmt mode) =
Right (d :: Data) ->
pure $ UPLC.Program () ver $ mkConstant () d

---------------- Benchmarking ----------------
Copy link
Contributor Author

@kwxm kwxm Jan 31, 2024

Choose a reason for hiding this comment

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

I'm not sure if all of the !/$!/force stuff is really necessary (maybe we don't need ! on term and anonTerm for example), but at least some of it is and anything extra probably doesn't do any harm.

@kwxm
Copy link
Contributor Author

kwxm commented Jan 31, 2024

/benchmark validation

@kwxm
Copy link
Contributor Author

kwxm commented Jan 31, 2024

^ Just to check if it's working.

Copy link
Contributor

Click here to check the status of your benchmark.

Copy link
Contributor

Comparing benchmark results of 'validation' on '8d66cbe71' (base) and '0473b8d09' (PR)

Results table
Script 8d66cbe 0473b8d Change
auction_1-1 167.2 μs 166.6 μs -0.4%
auction_1-2 613.2 μs 614.2 μs +0.2%
auction_1-3 614.0 μs 613.5 μs -0.1%
auction_1-4 218.0 μs 218.0 μs 0.0%
auction_2-1 167.9 μs 167.8 μs -0.1%
auction_2-2 613.7 μs 614.8 μs +0.2%
auction_2-3 805.9 μs 805.3 μs -0.1%
auction_2-4 612.3 μs 612.1 μs -0.0%
auction_2-5 218.0 μs 218.1 μs +0.0%
crowdfunding-success-1 197.0 μs 197.4 μs +0.2%
crowdfunding-success-2 196.7 μs 197.0 μs +0.2%
crowdfunding-success-3 197.0 μs 197.0 μs 0.0%
currency-1 239.8 μs 239.8 μs 0.0%
escrow-redeem_1-1 331.4 μs 331.8 μs +0.1%
escrow-redeem_1-2 331.5 μs 331.9 μs +0.1%
escrow-redeem_2-1 383.5 μs 383.2 μs -0.1%
escrow-redeem_2-2 384.5 μs 384.7 μs +0.1%
escrow-redeem_2-3 384.6 μs 384.2 μs -0.1%
escrow-refund-1 146.3 μs 146.3 μs 0.0%
future-increase-margin-1 240.5 μs 240.3 μs -0.1%
future-increase-margin-2 516.3 μs 515.8 μs -0.1%
future-increase-margin-3 516.5 μs 516.3 μs -0.0%
future-increase-margin-4 471.3 μs 470.0 μs -0.3%
future-increase-margin-5 782.6 μs 783.7 μs +0.1%
future-pay-out-1 241.6 μs 240.3 μs -0.5%
future-pay-out-2 515.5 μs 514.7 μs -0.2%
future-pay-out-3 517.6 μs 517.4 μs -0.0%
future-pay-out-4 787.8 μs 788.6 μs +0.1%
future-settle-early-1 240.5 μs 241.0 μs +0.2%
future-settle-early-2 516.1 μs 515.8 μs -0.1%
future-settle-early-3 517.0 μs 515.4 μs -0.3%
future-settle-early-4 587.5 μs 587.3 μs -0.0%
game-sm-success_1-1 367.8 μs 368.4 μs +0.2%
game-sm-success_1-2 187.7 μs 188.2 μs +0.3%
game-sm-success_1-3 618.1 μs 619.7 μs +0.3%
game-sm-success_1-4 213.5 μs 213.3 μs -0.1%
game-sm-success_2-1 370.0 μs 369.4 μs -0.2%
game-sm-success_2-2 188.0 μs 188.0 μs 0.0%
game-sm-success_2-3 618.3 μs 618.0 μs -0.0%
game-sm-success_2-4 212.1 μs 213.7 μs +0.8%
game-sm-success_2-5 617.6 μs 619.0 μs +0.2%
game-sm-success_2-6 214.6 μs 213.3 μs -0.6%
multisig-sm-1 376.6 μs 377.3 μs +0.2%
multisig-sm-2 366.5 μs 367.5 μs +0.3%
multisig-sm-3 372.8 μs 372.7 μs -0.0%
multisig-sm-4 376.1 μs 375.8 μs -0.1%
multisig-sm-5 532.8 μs 533.1 μs +0.1%
multisig-sm-6 378.2 μs 377.5 μs -0.2%
multisig-sm-7 366.0 μs 367.5 μs +0.4%
multisig-sm-8 371.7 μs 372.3 μs +0.2%
multisig-sm-9 376.2 μs 375.2 μs -0.3%
multisig-sm-10 535.9 μs 533.0 μs -0.5%
ping-pong-1 312.9 μs 313.0 μs +0.0%
ping-pong-2 312.8 μs 313.9 μs +0.4%
ping-pong_2-1 190.4 μs 190.4 μs 0.0%
prism-1 158.3 μs 158.0 μs -0.2%
prism-2 393.1 μs 393.7 μs +0.2%
prism-3 352.5 μs 353.2 μs +0.2%
pubkey-1 134.0 μs 134.2 μs +0.1%
stablecoin_1-1 878.5 μs 878.2 μs -0.0%
stablecoin_1-2 183.9 μs 184.3 μs +0.2%
stablecoin_1-3 1.010 ms 1.009 ms -0.1%
stablecoin_1-4 194.4 μs 194.6 μs +0.1%
stablecoin_1-5 1.299 ms 1.295 ms -0.3%
stablecoin_1-6 241.4 μs 241.0 μs -0.2%
stablecoin_2-1 877.7 μs 877.7 μs 0.0%
stablecoin_2-2 183.7 μs 183.7 μs 0.0%
stablecoin_2-3 1.010 ms 1.008 ms -0.2%
stablecoin_2-4 194.0 μs 194.3 μs +0.2%
token-account-1 181.4 μs 181.6 μs +0.1%
token-account-2 317.6 μs 318.2 μs +0.2%
uniswap-1 393.5 μs 394.5 μs +0.3%
uniswap-2 211.0 μs 211.3 μs +0.1%
uniswap-3 1.682 ms 1.682 ms 0.0%
uniswap-4 316.2 μs 317.0 μs +0.3%
uniswap-5 1.106 ms 1.108 ms +0.2%
uniswap-6 300.0 μs 301.6 μs +0.5%
vesting-1 331.5 μs 331.8 μs +0.1%

@effectfully
Copy link
Contributor

see the attached comparison. In general the benchmarks here are maybe 15-20% faster than the ones in plutus-benchmark

That is not how it supposed to be... Let me dive into it.

Copy link
Contributor

@effectfully effectfully left a comment

Choose a reason for hiding this comment

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

Nothing weird jumped on me, if we're certain that running the benchmarks via the executable is faster than via plutus-benchmark, then it definitely should be investigated.

-- Big names slow things down
!anonTerm = UPLC.termMapNames (\(PLC.NamedDeBruijn _ i) -> PLC.NamedDeBruijn "" i) term
-- Big annotations slow things down
!unitAnnTerm = force (() <$ anonTerm)
Copy link
Contributor

Choose a reason for hiding this comment

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

What if you remove () <$? Maybe it's the force that matters here rather than the annotations? Force sure is important there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What if you remove () <$? Maybe it's the force that matters here rather than the annotations? Force sure is important there.

The annotations definitely make a difference. I was seeing a discrepancy of 2-3% between flat files and textual files and after several hours I realised that they had different types of annotation: making all the annotations () removed the discrepancy.

runBenchmark (BenchmarkOptions inp ifmt semvar timeLim) = do
prog <- readProgram ifmt inp
let criterionConfig = defaultConfig {reportFile = Nothing, timeLimit = timeLim}
cekparams = mkMachineParameters semvar PLC.defaultCekCostModel
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to use PlutusCore.Evaluation.Machine.MachineParameters.Default.mkMachineParametersFor here instead? You'll need to apply it to from PlutusCore.Evaluation.Machine.ExBudgetingDefaults.defaultCostModelParams I think. Or something like that, the point is that we only track performance of builtins when mkMachineParametersFor is used and mkMachineParameters can be slower significantly (yes, even though the former uses the latter).

!anonTerm = UPLC.termMapNames (\(PLC.NamedDeBruijn _ i) -> PLC.NamedDeBruijn "" i) term
-- Big annotations slow things down
!unitAnnTerm = force (() <$ anonTerm)
benchmarkWith criterionConfig $! whnf evaluate unitAnnTerm
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to reuse Common.benchWith from the benchmarks to make sure it's not how we run the benchmarks that makes the difference?

@effectfully
Copy link
Contributor

Have you tried comparing benchmarking results of the executable run against results of another executable run? Maybe some -threaded or whatever somehow leaks in there and the executable simply doesn't produce reliable numbers?

@kwxm
Copy link
Contributor Author

kwxm commented Feb 2, 2024

Have you tried comparing benchmarking results of the executable run against results of another executable run?

Yes, I ran it dozens of times and used taskset to pin the process to the same core every time. I also adjusted my CPU settings to try to reduce the variability of the CPU frequency as much as possible. The results of repeated runs were pretty consistent.

@kwxm
Copy link
Contributor Author

kwxm commented Feb 2, 2024

^ Here are two runs on the game-sm examples from about an hour apart. I was even reviewing a PR at the same time, which might explain the glitch in number 2_1

Script                              Old            New         Change
----------------------------------------------------------------------------------
game-sm-success_1-1.flat          426.2 μs	 428.2 μs      +0.5%
game-sm-success_1-2.flat          204.4 μs	 208.0 μs      +1.8%
game-sm-success_1-3.flat          750.3 μs	 754.7 μs      +0.6%
game-sm-success_1-4.flat          230.3 μs	 231.7 μs      +0.6%
game-sm-success_2-1.flat          424.5 μs	 434.3 μs      +2.3%
game-sm-success_2-2.flat          204.7 μs	 204.9 μs      +0.1%
game-sm-success_2-3.flat          751.7 μs	 749.0 μs      -0.4%
game-sm-success_2-4.flat          230.8 μs	 230.9 μs      +0.0%
game-sm-success_2-5.flat          752.1 μs	 750.6 μs      -0.2%
game-sm-success_2-6.flat          229.8 μs	 231.6 μs      +0.8%

@kwxm
Copy link
Contributor Author

kwxm commented Feb 2, 2024

Here's what happens if I replace () <$ with (78438924852734572435135467814913647137417845844352783456782654::Integer) <$.

Script                              Old            New         Change
----------------------------------------------------------------------------------
game-sm-success_1-1.flat          426.2 μs	 436.4 μs      +2.4%
game-sm-success_1-2.flat          204.4 μs	 209.9 μs      +2.7%
game-sm-success_1-3.flat          750.3 μs	 762.7 μs      +1.7%
game-sm-success_1-4.flat          230.3 μs	 236.1 μs      +2.5%
game-sm-success_2-1.flat          424.5 μs	 435.7 μs      +2.6%
game-sm-success_2-2.flat          204.7 μs	 209.7 μs      +2.4%
game-sm-success_2-3.flat          751.7 μs	 764.7 μs      +1.7%
game-sm-success_2-4.flat          230.8 μs	 236.8 μs      +2.6%
game-sm-success_2-5.flat          752.1 μs	 766.1 μs      +1.9%
game-sm-success_2-6.flat          229.8 μs	 236.2 μs      +2.8%

@kwxm
Copy link
Contributor Author

kwxm commented Feb 2, 2024

I accidentally pushed some stuff that should be in another branch. Let me try to fix that.

... OK, I think that worked.

@kwxm
Copy link
Contributor Author

kwxm commented Feb 2, 2024

see the attached comparison. In general the benchmarks here are maybe 15-20% faster than the ones in plutus-benchmark

That is not how it supposed to be... Let me dive into it.

@effectfully My intention here was just to provide a quick way of doing some benchmarking when I'm experimenting, so I wasn't too worried about the differences from the "real" benchmarking results. However, I do have a branch here where I copied in lots of stuff from plutus-benchmark and plutus-ledger-api to try to make it as close to what happens in plutus-benchmark as possible in order to see how much difference the extra overhead made. The numbers are closer to the ones from plutus-benchmark, but the scripts still appear to be faster with uplc (see the attached results). I would like to find out exactly what's going on here (especially with the highly anomalous multisig-sm results), but it could take a very long time! Maybe we should have a proper action to look into this. Also, having a really consistent machine for running these things on would be helpful.

Script                        plutus-benchmark     uplc       Change
----------------------------------------------------------------------------------
auction_1-1                       217.3 μs	 213.8 μs      -1.6%
auction_1-2                       854.9 μs	 806.5 μs      -5.7%
auction_1-3                       843.6 μs	 792.5 μs      -6.1%
auction_1-4                       292.2 μs	 275.4 μs      -5.7%
auction_2-1                       226.2 μs	 214.0 μs      -5.4%
auction_2-2                       853.2 μs	 809.8 μs      -5.1%
auction_2-3                       1.114 ms	 1.058 ms      -5.0%
auction_2-4                       835.6 μs	 801.6 μs      -4.1%
auction_2-5                       292.3 μs	 277.8 μs      -5.0%
crowdfunding-success-1            266.8 μs	 251.7 μs      -5.7%
crowdfunding-success-2            265.7 μs	 251.9 μs      -5.2%
crowdfunding-success-3            266.5 μs	 253.1 μs      -5.0%
currency-1                        323.9 μs	 304.6 μs      -6.0%
escrow-redeem_1-1                 449.4 μs	 422.5 μs      -6.0%
escrow-redeem_1-2                 449.7 μs	 423.8 μs      -5.8%
escrow-redeem_2-1                 520.9 μs	 494.9 μs      -5.0%
escrow-redeem_2-2                 521.2 μs	 493.7 μs      -5.3%
escrow-redeem_2-3                 519.3 μs	 493.3 μs      -5.0%
escrow-refund-1                   196.9 μs	 186.9 μs      -5.1%
future-increase-margin-1          324.1 μs	 304.5 μs      -6.0%
future-increase-margin-2          700.6 μs	 667.6 μs      -4.7%
future-increase-margin-3          700.5 μs	 663.9 μs      -5.2%
future-increase-margin-4          655.2 μs	 613.0 μs      -6.4%
future-increase-margin-5          1.122 ms	 1.069 ms      -4.7%
future-pay-out-1                  323.9 μs	 305.7 μs      -5.6%
future-pay-out-2                  701.7 μs	 666.3 μs      -5.0%
future-pay-out-3                  703.8 μs	 665.7 μs      -5.4%
future-pay-out-4                  1.111 ms	 1.081 ms      -2.7%
future-settle-early-1             323.0 μs	 306.1 μs      -5.2%
future-settle-early-2             700.8 μs	 665.4 μs      -5.1%
future-settle-early-3             703.7 μs	 664.7 μs      -5.5%
future-settle-early-4             812.9 μs	 795.8 μs      -2.1%
game-sm-success_1-1               501.8 μs	 476.8 μs      -5.0%
game-sm-success_1-2               250.8 μs	 236.3 μs      -5.8%
game-sm-success_1-3               852.0 μs	 824.5 μs      -3.2%
game-sm-success_1-4               287.1 μs	 267.0 μs      -7.0%
game-sm-success_2-1               504.9 μs	 476.6 μs      -5.6%
game-sm-success_2-2               253.4 μs	 237.3 μs      -6.4%
game-sm-success_2-3               851.2 μs	 828.9 μs      -2.6%
game-sm-success_2-4               286.3 μs	 269.2 μs      -6.0%
game-sm-success_2-5               851.6 μs	 825.2 μs      -3.1%
game-sm-success_2-6               286.6 μs	 268.9 μs      -6.2%
multisig-sm-1                     515.5 μs	 491.0 μs      -4.8%
multisig-sm-2                     505.1 μs	 695.8 μs     +37.8%
multisig-sm-3                     511.7 μs	 470.3 μs      -8.1%
multisig-sm-4                     512.9 μs	 478.2 μs      -6.8%
multisig-sm-5                     741.4 μs	 483.5 μs     -34.8%
multisig-sm-6                     512.7 μs	 696.2 μs     +35.8%
multisig-sm-7                     502.2 μs	 488.7 μs      -2.7%
multisig-sm-8                     508.2 μs	 473.2 μs      -6.9%
multisig-sm-9                     514.4 μs	 477.7 μs      -7.1%
multisig-sm-10                    739.1 μs	 485.8 μs     -34.3%
ping-pong-1                       421.5 μs	 400.9 μs      -4.9%
ping-pong-2                       424.3 μs	 399.5 μs      -5.8%
ping-pong_2-1                     255.7 μs	 240.9 μs      -5.8%
prism-1                           212.8 μs	 200.4 μs      -5.8%
prism-2                           535.4 μs	 506.2 μs      -5.5%
prism-3                           472.7 μs	 447.1 μs      -5.4%
pubkey-1                          180.0 μs	 167.3 μs      -7.1%
stablecoin_1-1                    1.237 ms	 1.205 ms      -2.6%
stablecoin_1-2                    247.9 μs	 230.3 μs      -7.1%
stablecoin_1-3                    1.433 ms	 1.393 ms      -2.8%
stablecoin_1-4                    261.8 μs	 245.7 μs      -6.1%
stablecoin_1-5                    1.871 ms	 1.803 ms      -3.6%
stablecoin_1-6                    325.1 μs	 302.6 μs      -6.9%
stablecoin_2-1                    1.235 ms	 1.205 ms      -2.4%
stablecoin_2-2                    247.8 μs	 231.4 μs      -6.6%
stablecoin_2-3                    1.424 ms	 1.393 ms      -2.2%
stablecoin_2-4                    261.9 μs	 247.1 μs      -5.7%
token-account-1                   243.1 μs	 227.3 μs      -6.5%
token-account-2                   429.2 μs	 404.7 μs      -5.7%
uniswap-1                         536.9 μs	 509.6 μs      -5.1%
uniswap-2                         284.5 μs	 269.7 μs      -5.2%
uniswap-3                         2.365 ms	 2.361 ms      -0.2%
uniswap-4                         423.7 μs	 399.9 μs      -5.6%
uniswap-5                         1.546 ms	 1.544 ms      -0.1%
uniswap-6                         400.1 μs	 383.3 μs      -4.2%
vesting-1                         447.7 μs	 427.9 μs      -4.4%

Just to be clear about how these relate to the previous results; I re-ran all of the validation benchmarks in plutus-benchmark (but pinned to a particular CPU, the same one as for the uplc results) to get the above figures. A comparison of the results for plutus-benchmark with the previous ones starts as shown below and carries on in the same way. The new set of results is systematically slower by a percent or so, but the changes in the results from uplc are much bigger, so I think we can believe them.

Script                              Old            New         Change
----------------------------------------------------------------------------------
auction_1-1                       215.7 μs	 217.3 μs      +0.7%
auction_1-2                       848.4 μs	 854.9 μs      +0.8%
auction_1-3                       839.1 μs	 843.6 μs      +0.5%
auction_1-4                       291.5 μs	 292.2 μs      +0.2%
auction_2-1                       224.6 μs	 226.2 μs      +0.7%
auction_2-2                       844.6 μs	 853.2 μs      +1.0%
auction_2-3                       1.097 ms	 1.114 ms      +1.5%
auction_2-4                       837.9 μs	 835.6 μs      -0.3%
auction_2-5                       289.9 μs	 292.3 μs      +0.8%

@kwxm
Copy link
Contributor Author

kwxm commented Feb 6, 2024

@effectfully I'm going to merge this. Please make a ticket if you want to investigate further. I'd also like to pin down exactly what's causing our standard benchmarks to take longer!

@kwxm kwxm merged commit 84a3742 into master Feb 6, 2024
5 checks passed
@kwxm kwxm deleted the kwxm/uplc-criterion branch February 6, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants