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

Unrestricted force #5112

Closed
wants to merge 1 commit into from
Closed

Unrestricted force #5112

wants to merge 1 commit into from

Conversation

michaelpj
Copy link
Contributor

Don't look here yet. This is an experiment I've wanted to do for a
while, just looking to get some benchmark numbers.

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Don't look here yet. This is an experiment I've wanted to do for a
while, just looking to get some benchmark numbers.
@michaelpj
Copy link
Contributor Author

/benchmark plutus-benchmark:nofib

@michaelpj michaelpj added the EXPERIMENT Experiments that we probably don't want to merge label Feb 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

Comparing benchmark results of ' plutus-benchmark:nofib' on '9fabd96d2' (base) and '6414603b4' (PR)

Results table
Script 9fabd96 6414603 Change
clausify/formula1 19.24 ms 19.22 ms -0.1%
clausify/formula2 24.53 ms 24.38 ms -0.6%
clausify/formula3 67.09 ms 66.40 ms -1.0%
clausify/formula4 95.43 ms 94.18 ms -1.3%
clausify/formula5 424.7 ms 419.7 ms -1.2%
knights/4x4 54.70 ms 53.41 ms -2.4%
knights/6x6 143.7 ms 142.0 ms -1.2%
knights/8x8 236.8 ms 234.7 ms -0.9%
primetest/05digits 27.67 ms 27.46 ms -0.8%
primetest/08digits 49.45 ms 49.46 ms +0.0%
primetest/10digits 69.15 ms 68.86 ms -0.4%
primetest/20digits 143.0 ms 142.7 ms -0.2%
primetest/30digits 210.3 ms 210.5 ms +0.1%
primetest/40digits 289.5 ms 291.1 ms +0.6%
primetest/50digits 276.2 ms 276.4 ms +0.1%
queens4x4/bt 9.905 ms 9.601 ms -3.1%
queens4x4/bm 13.94 ms 13.77 ms -1.2%
queens4x4/bjbt1 12.59 ms 12.33 ms -2.1%
queens4x4/bjbt2 13.21 ms 12.87 ms -2.6%
queens4x4/fc 30.99 ms 30.52 ms -1.5%
queens5x5/bt 128.8 ms 125.7 ms -2.4%
queens5x5/bm 164.2 ms 161.1 ms -1.9%
queens5x5/bjbt1 160.0 ms 153.3 ms -4.2%
queens5x5/bjbt2 163.0 ms 161.2 ms -1.1%
queens5x5/fc 387.9 ms 382.2 ms -1.5%

@michaelpj
Copy link
Contributor Author

/benchmark plutus-benchmark:validation

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2023

Comparing benchmark results of ' plutus-benchmark:validation' on '9fabd96d2' (base) and '6414603b4' (PR)

Results table
Script 9fabd96 6414603 Change
auction_1-1 148.0 μs 151.0 μs +2.0%
auction_1-2 655.2 μs 650.0 μs -0.8%
auction_1-3 642.7 μs 640.2 μs -0.4%
auction_1-4 190.6 μs 195.7 μs +2.7%
auction_2-1 150.9 μs 153.8 μs +1.9%
auction_2-2 646.9 μs 650.6 μs +0.6%
auction_2-3 854.4 μs 862.5 μs +0.9%
auction_2-4 642.0 μs 641.0 μs -0.2%
auction_2-5 189.9 μs 196.8 μs +3.6%
crowdfunding-success-1 178.3 μs 180.8 μs +1.4%
crowdfunding-success-2 178.0 μs 181.9 μs +2.2%
crowdfunding-success-3 177.9 μs 181.9 μs +2.2%
currency-1 235.2 μs 237.4 μs +0.9%
escrow-redeem_1-1 326.1 μs 330.7 μs +1.4%
escrow-redeem_1-2 326.6 μs 328.3 μs +0.5%
escrow-redeem_2-1 379.6 μs 382.7 μs +0.8%
escrow-redeem_2-2 380.2 μs 386.0 μs +1.5%
escrow-redeem_2-3 383.7 μs 385.5 μs +0.5%
escrow-refund-1 132.2 μs 134.7 μs +1.9%
future-increase-margin-1 236.6 μs 236.6 μs 0.0%
future-increase-margin-2 518.7 μs 519.5 μs +0.2%
future-increase-margin-3 518.1 μs 519.3 μs +0.2%
future-increase-margin-4 485.1 μs 488.5 μs +0.7%
future-increase-margin-5 855.2 μs 856.9 μs +0.2%
future-pay-out-1 235.3 μs 236.5 μs +0.5%
future-pay-out-2 517.3 μs 522.6 μs +1.0%
future-pay-out-3 518.3 μs 517.7 μs -0.1%
future-pay-out-4 852.9 μs 859.0 μs +0.7%
future-settle-early-1 235.3 μs 235.9 μs +0.3%
future-settle-early-2 517.2 μs 518.8 μs +0.3%
future-settle-early-3 518.0 μs 518.9 μs +0.2%
future-settle-early-4 634.4 μs 638.4 μs +0.6%
game-sm-success_1-1 373.9 μs 377.1 μs +0.9%
game-sm-success_1-2 162.8 μs 167.9 μs +3.1%
game-sm-success_1-3 635.4 μs 638.0 μs +0.4%
game-sm-success_1-4 191.6 μs 195.0 μs +1.8%
game-sm-success_2-1 374.1 μs 376.4 μs +0.6%
game-sm-success_2-2 163.5 μs 166.9 μs +2.1%
game-sm-success_2-3 634.6 μs 637.0 μs +0.4%
game-sm-success_2-4 190.8 μs 195.8 μs +2.6%
game-sm-success_2-5 639.3 μs 641.4 μs +0.3%
game-sm-success_2-6 191.0 μs 194.7 μs +1.9%
multisig-sm-1 388.1 μs 391.5 μs +0.9%
multisig-sm-2 379.8 μs 380.3 μs +0.1%
multisig-sm-3 381.9 μs 383.6 μs +0.4%
multisig-sm-4 380.1 μs 382.5 μs +0.6%
multisig-sm-5 565.6 μs 566.7 μs +0.2%
multisig-sm-6 387.1 μs 391.3 μs +1.1%
multisig-sm-7 377.6 μs 381.2 μs +1.0%
multisig-sm-8 385.6 μs 386.8 μs +0.3%
multisig-sm-9 381.9 μs 385.1 μs +0.8%
multisig-sm-10 565.8 μs 566.4 μs +0.1%
ping-pong-1 317.1 μs 318.2 μs +0.3%
ping-pong-2 317.7 μs 319.0 μs +0.4%
ping-pong_2-1 180.5 μs 181.9 μs +0.8%
prism-1 137.7 μs 140.3 μs +1.9%
prism-2 396.6 μs 396.6 μs 0.0%
prism-3 335.0 μs 338.3 μs +1.0%
pubkey-1 116.6 μs 118.7 μs +1.8%
stablecoin_1-1 950.9 μs 951.1 μs +0.0%
stablecoin_1-2 160.5 μs 164.6 μs +2.6%
stablecoin_1-3 1.089 ms 1.094 ms +0.5%
stablecoin_1-4 170.4 μs 174.7 μs +2.5%
stablecoin_1-5 1.375 ms 1.377 ms +0.1%
stablecoin_1-6 212.3 μs 217.3 μs +2.4%
stablecoin_2-1 950.5 μs 948.4 μs -0.2%
stablecoin_2-2 160.6 μs 165.0 μs +2.7%
stablecoin_2-3 1.087 ms 1.094 ms +0.6%
stablecoin_2-4 170.4 μs 175.5 μs +3.0%
token-account-1 172.9 μs 173.5 μs +0.3%
token-account-2 309.6 μs 311.4 μs +0.6%
uniswap-1 407.7 μs 408.0 μs +0.1%
uniswap-2 201.5 μs 201.5 μs 0.0%
uniswap-3 1.771 ms 1.770 ms -0.1%
uniswap-4 279.6 μs 282.6 μs +1.1%
uniswap-5 1.138 ms 1.134 ms -0.4%
uniswap-6 271.5 μs 275.1 μs +1.3%
vesting-1 334.8 μs 337.0 μs +0.7%

@L-as
Copy link
Contributor

L-as commented Feb 6, 2023

Rather than doing this as a post-hoc optimisation, why not omit emitting unnecessary delays and forces? That seems like a simpler thing to do.

@L-as
Copy link
Contributor

L-as commented Feb 6, 2023

You could in PIR make one constructor for both type abstractions and lambdas of arbitrary (type) parameters, which would seemingly allow you to emit more optimised UPLC.

@michaelpj
Copy link
Contributor Author

Rather than doing this as a post-hoc optimisation, why not omit emitting unnecessary delays and forces? That seems like a simpler thing to do.

I disagree with this as a compiler design principle. IME (and I think this is the standard wisdom) it's almost always better to make code-gen as dumb as possible and then optimize away the bad stuff. That makes your code gen simpler (which is important since it's almost always pretty complicated anyway), and your optimizations will benefit you in other places.

@michaelpj
Copy link
Contributor Author

Pretty modest tbh, slightly disappointing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EXPERIMENT Experiments that we probably don't want to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants