Skip to content

Commit

Permalink
Avoid division by zero in benchmark comparisons (#6665)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwxm authored Nov 14, 2024
1 parent 01fdff8 commit 1d9a758
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions plutus-benchmark/bench-compare-markdown
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ paste -d " " "$TMP1" "$TMP2" |
else return (sprintf ("%.1f %s", t, ustr[unit]))
}
function percentage_change (t1, t2, d, sign) {
if (t1==0) return (" - ") # Avoid division by zero, just in case
d = (t2-t1)/t1 * 100
sign = (d<0) ? "" : ((d==0) ? " " : "+") # We get the "-" anyway if d<0
return (sprintf ("%s%.1f%%", sign, d))
Expand Down

1 comment on commit 1d9a758

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Plutus Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: 1d9a758 Previous: 01fdff8 Ratio
validation-escrow-redeem_2-3 584.8 μs 414.9 μs 1.41
validation-escrow-refund-1 223 μs 162.7 μs 1.37
validation-future-increase-margin-1 356.9 μs 260.2 μs 1.37
validation-future-increase-margin-2 768.4 μs 564.9 μs 1.36
validation-future-increase-margin-3 768.8 μs 562.9 μs 1.37
validation-future-increase-margin-4 693.9 μs 508.2 μs 1.37
validation-future-increase-margin-5 1159 μs 848.4 μs 1.37
validation-future-pay-out-1 356 μs 260.5 μs 1.37
validation-future-pay-out-2 765.8 μs 561.5 μs 1.36
validation-future-pay-out-3 769 μs 561.6 μs 1.37
validation-future-pay-out-4 1151 μs 843.5 μs 1.36
validation-future-settle-early-1 355.7 μs 261.3 μs 1.36
validation-future-settle-early-2 766.9 μs 559.4 μs 1.37
validation-future-settle-early-3 766.7 μs 561.6 μs 1.37
validation-future-settle-early-4 855 μs 628.3 μs 1.36
validation-game-sm-success_1-1 517 μs 403.3 μs 1.28
validation-game-sm-success_2-1 511.1 μs 403.5 μs 1.27
validation-game-sm-success_2-2 286.6 μs 208.9 μs 1.37
validation-game-sm-success_2-3 908 μs 664.8 μs 1.37
validation-game-sm-success_2-4 334.8 μs 245.6 μs 1.36
validation-game-sm-success_2-5 908.2 μs 664 μs 1.37
validation-game-sm-success_2-6 335.7 μs 245.3 μs 1.37
validation-multisig-sm-1 440.4 μs 411.4 μs 1.07
validation-multisig-sm-3 444.9 μs 405.2 μs 1.10
validation-multisig-sm-4 560.6 μs 408.4 μs 1.37
validation-multisig-sm-5 788.6 μs 676 μs 1.17
validation-prism-3 527.3 μs 385 μs 1.37
validation-pubkey-1 157.8 μs 147.6 μs 1.07
validation-stablecoin_1-1 1284 μs 940.2 μs 1.37
validation-stablecoin_1-2 280.4 μs 205 μs 1.37
validation-stablecoin_1-3 1478 μs 1084 μs 1.36
validation-stablecoin_1-4 300.3 μs 218.8 μs 1.37
validation-stablecoin_1-5 1911 μs 1394 μs 1.37
validation-stablecoin_1-6 338.3 μs 270.3 μs 1.25
validation-stablecoin_2-1 1033 μs 939.4 μs 1.10
validation-stablecoin_2-3 1483 μs 1082 μs 1.37
validation-stablecoin_2-4 299.3 μs 218.4 μs 1.37
validation-token-account-1 267.6 μs 196.7 μs 1.36
validation-uniswap-1 586.6 μs 544.1 μs 1.08
validation-uniswap-2 314.3 μs 230.2 μs 1.37
validation-uniswap-3 2506 μs 1830 μs 1.37
validation-uniswap-4 483.2 μs 353.2 μs 1.37
validation-decode-auction_1-1 275.4 μs 200.6 μs 1.37
validation-decode-auction_1-2 771.9 μs 564.9 μs 1.37
validation-decode-auction_1-3 773.2 μs 566.7 μs 1.36
validation-decode-auction_1-4 275.1 μs 201 μs 1.37
validation-decode-auction_2-1 275.2 μs 202.2 μs 1.36
validation-decode-crowdfunding-success-1 335.9 μs 289.7 μs 1.16
validation-decode-crowdfunding-success-2 336.5 μs 237.7 μs 1.42
validation-decode-crowdfunding-success-3 336.2 μs 237.6 μs 1.41
validation-decode-currency-1 331.2 μs 238.3 μs 1.39
validation-decode-escrow-redeem_1-1 450 μs 316 μs 1.42
validation-decode-escrow-redeem_1-2 447.9 μs 316.6 μs 1.41
validation-decode-escrow-redeem_2-1 448.6 μs 318.1 μs 1.41
validation-decode-escrow-redeem_2-2 449.5 μs 316.2 μs 1.42
validation-decode-escrow-redeem_2-3 451.6 μs 316.3 μs 1.43
validation-decode-escrow-refund-1 447.8 μs 315.6 μs 1.42
validation-decode-future-increase-margin-1 339 μs 297.7 μs 1.14
validation-decode-future-increase-margin-4 933 μs 716.6 μs 1.30
validation-decode-future-increase-margin-5 747.6 μs 705.6 μs 1.06
validation-decode-future-pay-out-1 307.7 μs 247.8 μs 1.24
validation-decode-future-pay-out-2 447.1 μs 329.7 μs 1.36
validation-decode-future-pay-out-3 451.3 μs 328.4 μs 1.37
validation-decode-future-settle-early-1 329.4 μs 241.9 μs 1.36
validation-decode-future-settle-early-2 450.5 μs 329.5 μs 1.37
validation-decode-future-settle-early-3 451.5 μs 330.2 μs 1.37
validation-decode-future-settle-early-4 975.5 μs 716.5 μs 1.36
validation-decode-game-sm-success_1-1 751.7 μs 548 μs 1.37
validation-decode-game-sm-success_1-2 206.8 μs 169.4 μs 1.22
validation-decode-game-sm-success_2-2 187.9 μs 173.6 μs 1.08
validation-decode-prism-2 750.4 μs 666.6 μs 1.13
validation-decode-prism-3 341.1 μs 249.3 μs 1.37
validation-decode-pubkey-1 233.2 μs 170.4 μs 1.37
validation-decode-stablecoin_1-1 1213 μs 893.4 μs 1.36
validation-decode-stablecoin_1-2 232.1 μs 169.5 μs 1.37
validation-decode-stablecoin_1-3 1225 μs 901.7 μs 1.36
validation-decode-stablecoin_1-4 233.1 μs 173.7 μs 1.34
validation-decode-stablecoin_1-5 1201 μs 902.9 μs 1.33
validation-decode-stablecoin_1-6 230.6 μs 169.9 μs 1.36
validation-decode-stablecoin_2-1 1225 μs 899.9 μs 1.36
validation-decode-stablecoin_2-2 217.3 μs 166.8 μs 1.30
nofib-clausify/formula3 15970 μs 11590 μs 1.38
nofib-clausify/formula4 36590 μs 26560 μs 1.38
nofib-clausify/formula5 77290 μs 56020 μs 1.38
nofib-knights/4x4 25340 μs 18340 μs 1.38
nofib-knights/6x6 66430 μs 48390 μs 1.37
nofib-knights/8x8 117000 μs 85280 μs 1.37
nofib-primetest/05digits 15070 μs 10870 μs 1.39
nofib-primetest/10digits 29470 μs 21250 μs 1.39
nofib-primetest/30digits 91270 μs 65620 μs 1.39
nofib-primetest/50digits 151000 μs 108400 μs 1.39
nofib-queens4x4/bt 7690 μs 5574 μs 1.38
nofib-queens4x4/bm 9656 μs 7028 μs 1.37
nofib-queens4x4/bjbt1 9315 μs 6761 μs 1.38
nofib-queens4x4/bjbt2 8726 μs 6337 μs 1.38
nofib-queens4x4/fc 19610 μs 14250 μs 1.38
marlowe-semantics/1a2f2540121f09321216090b2b1f211e3f020c2c133a1a3c3f3c232a26153a04 453.8 μs 349.8 μs 1.30
marlowe-semantics/1a573aed5c46d637919ccb5548dfc22a55c9fc38298d567d15ee9f2eea69d89e 1349 μs 952.2 μs 1.42
marlowe-semantics/1d56060c3b271226064c672a282663643b1b0823471c67737f0b076870331260 1166 μs 823.6 μs 1.42
marlowe-semantics/1d6e3c137149a440f35e0efc685b16bfb8052ebcf66ec4ad77e51c11501381c7 454.2 μs 319.7 μs 1.42
marlowe-semantics/1f0f02191604101e1f201016171604060d010d1d1c150e110a110e1006160a0d 1452 μs 1014.9999999999999 μs 1.43
marlowe-semantics/202d273721330b31193405101e0637202e2a0f1140211c3e3f171e26312b0220 8119.999999999999 μs 6009 μs 1.35
marlowe-semantics/322acde099bc34a929182d5b894214fc87ec88446e2d10625119a9d17fa3ec3d 451.8 μs 423.8 μs 1.07
marlowe-semantics/331e4a1bb30f28d7073c54f9a13c10ae19e2e396c299a0ce101ee6bf4b2020db 694.6 μs 508.2 μs 1.37
marlowe-semantics/33c3efd79d9234a78262b52bc6bbf8124cb321a467dedb278328215167eca455 936.5 μs 683 μs 1.37
marlowe-semantics/383683bfcecdab0f4df507f59631c702bd11a81ca3841f47f37633e8aacbb5de 1131 μs 827.9 μs 1.37
marlowe-semantics/3bb75b2e53eb13f718eacd3263ab4535f9137fabffc9de499a0de7cabb335479 451.6 μs 331.4 μs 1.36
marlowe-semantics/3db496e6cd39a8b888a89d0de07dace4397878958cab3b9d9353978b08c36d8a 1241 μs 908.2 μs 1.37
marlowe-semantics/44a9e339fa25948b48637fe7e10dcfc6d1256319a7b5ce4202cb54dfef8e37e7 451.6 μs 331 μs 1.36
marlowe-semantics/4c3efd13b6c69112a8a888372d56c86e60c232125976f29b1c3e21d9f537845c 1523 μs 1115 μs 1.37
marlowe-semantics/4d7adf91bfc93cebe95a7e054ec17cfbb912b32bd8aecb48a228b50e02b055c8 1037 μs 759.9 μs 1.36
marlowe-semantics/4f9e8d361b85e62db2350dd3ae77463540e7af0d28e1eb68faeecc45f4655f57 592.5 μs 432.7 μs 1.37
marlowe-semantics/52df7c8dfaa5f801cd837faa65f2fd333665fff00a555ce8c55e36ddc003007a 539.5 μs 398.9 μs 1.35
marlowe-semantics/c9efcb705ee057791f7c18a1de79c49f6e40ba143ce0579f1602fd780cabf153 1218 μs 895.4 μs 1.36
marlowe-semantics/ccab11ce1a8774135d0e3c9e635631b68af9e276b5dabc66ff669d5650d0be1c 1151 μs 1057 μs 1.09
marlowe-role-payout/f53e8cafe26647ccce51e4c31db13608aea1f39034c0f52dee2e5634ef66e747 236.1 μs 207.9 μs 1.14
marlowe-role-payout/f7275afb60e33a550df13a132102e7e925dd28965a4efbe510a89b077ff9417f 224.3 μs 191.6 μs 1.17

This comment was automatically generated by workflow using github-action-benchmark.

CC: @IntersectMBO/plutus-core

Please sign in to comment.