Skip to content

Commit

Permalink
Upse taskset in ci-plutu-benchmark.sh (#6646)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored Nov 10, 2024
1 parent 9d46897 commit 085b74b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ in
pkgs.fswatch
pkgs.yarn

# This is used to get `taskset` for ./scripts/ci-plutus-benchmark.sh, but
# it's not available on macOS.
pkgs.util-linux

# TODO lickcheker is broke in nixpkgs-usnstable, remove this when it's fixed
# pkgs.linkchecker
inputs.nixpkgs-2405.legacyPackages.linkchecker
Expand Down
20 changes: 18 additions & 2 deletions scripts/ci-plutus-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# fetch/build this each time since we want to run this in a clean environment.
# The `jq` invocation below is necessary because we have to POST the PR comment as JSON data
# (see the curl command) meaning the script output has to be escaped first before we can insert it.
# Also note the use of the envvar CAPABILITY_NUM and `taskset -c` to limit
# the benchmark to a single core. Experiments have shown that this can lead to more stable results.
# This is only available on linux.

set -e

Expand All @@ -36,6 +39,13 @@ else
git checkout "$PR_BRANCH"
fi

if [ -z "$CAPABILITY_NUM" ] ; then
echo "[ci-plutus-benchmark]: 'CAPABILITY_NUM' is not set, will default to 2"
CAPABILITY_NUM=2
else
echo "[ci-plutus-benchmark]: 'CAPABILITY_NUM' set to $CAPABILITY_NUM"
fi

PR_BRANCH_REF="$(git rev-parse --short HEAD)"

if [ -z "$(git merge-base HEAD origin/master)" ]; then
Expand All @@ -55,8 +65,14 @@ cabal update
echo "[ci-plutus-benchmark]: Clearing caches with cabal clean ..."
cabal clean

if [[ -z $(which taskset) ]]; then
TASKSET="taskset -c $CAPABILITY_NUM"
else
TASKSET=""
fi

echo "[ci-plutus-benchmark]: Running benchmark for PR branch at $PR_BRANCH_REF ..."
2>&1 cabal bench "$BENCHMARK_NAME" | tee bench-PR.log
2>&1 $TASKSET cabal bench "$BENCHMARK_NAME" | tee bench-PR.log

echo "[ci-plutus-benchmark]: Switching branches ..."
git checkout "$(git merge-base HEAD origin/master)"
Expand All @@ -66,7 +82,7 @@ echo "[ci-plutus-benchmark]: Clearing caches with cabal clean ..."
cabal clean

echo "[ci-plutus-benchmark]: Running benchmark for base branch at $BASE_BRANCH_REF ..."
2>&1 cabal bench "$BENCHMARK_NAME" | tee bench-base.log
2>&1 $TASKSET cabal bench "$BENCHMARK_NAME" | tee bench-base.log
git checkout "$PR_BRANCH_REF" # .. so we use the most recent version of the comparison script

echo "[ci-plutus-benchmark]: Comparing results ..."
Expand Down

1 comment on commit 085b74b

@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: 085b74b Previous: 9d46897 Ratio
validation-auction_2-1 187.4 μs 175.5 μs 1.07
validation-auction_2-2 668.5 μs 625.2 μs 1.07
validation-auction_2-3 871.2 μs 822 μs 1.06
validation-auction_2-4 659.6 μs 624.1 μs 1.06
validation-auction_2-5 242.2 μs 228.1 μs 1.06
validation-game-sm-success_1-3 909.8 μs 661.7 μs 1.37
validation-game-sm-success_1-4 290.1 μs 243.1 μs 1.19
validation-game-sm-success_2-2 254.5 μs 208.5 μs 1.22
validation-game-sm-success_2-5 757 μs 664.9 μs 1.14
validation-game-sm-success_2-6 335.5 μs 243.4 μs 1.38
validation-multisig-sm-1 561.4 μs 410.2 μs 1.37
validation-multisig-sm-2 548.6 μs 399.1 μs 1.37
validation-multisig-sm-3 545.4 μs 403.1 μs 1.35
validation-prism-2 452.6 μs 427.7 μs 1.06
validation-token-account-1 256.4 μs 240.8 μs 1.06
validation-uniswap-4 382.4 μs 350.3 μs 1.09
validation-decode-auction_1-4 265 μs 201.8 μs 1.31
validation-decode-auction_2-2 771.9 μs 566.3 μs 1.36
validation-decode-auction_2-3 755 μs 567.7 μs 1.33
validation-decode-auction_2-4 754.3 μs 566.9 μs 1.33
validation-decode-auction_2-5 275.3 μs 201.5 μs 1.37
validation-decode-crowdfunding-success-1 335 μs 246.2 μs 1.36
validation-decode-crowdfunding-success-2 335.4 μs 245 μs 1.37
validation-decode-crowdfunding-success-3 313 μs 238.2 μs 1.31
validation-decode-game-sm-success_2-2 228.5 μs 169.1 μs 1.35
validation-decode-game-sm-success_2-3 750.5 μs 550.2 μs 1.36
validation-decode-game-sm-success_2-4 228.9 μs 171.3 μs 1.34
validation-decode-multisig-sm-7 814.9 μs 599.4 μs 1.36
validation-decode-multisig-sm-8 834.2 μs 609.6 μs 1.37
validation-decode-multisig-sm-9 833.4 μs 597.9 μs 1.39
validation-decode-multisig-sm-10 831.3 μs 597 μs 1.39
validation-decode-ping-pong-1 702.2 μs 509.4 μs 1.38
validation-decode-ping-pong-2 701.2 μs 512.4 μs 1.37
validation-decode-ping-pong_2-1 700.3 μs 514.4 μs 1.36
validation-decode-prism-1 228.6 μs 167.6 μs 1.36
validation-decode-prism-2 745.3 μs 536.8 μs 1.39
validation-decode-prism-3 339.3 μs 250.3 μs 1.36
validation-decode-pubkey-1 232.2 μs 174.9 μs 1.33
validation-decode-stablecoin_1-1 1197 μs 902.6 μs 1.33
validation-decode-stablecoin_1-2 229.8 μs 171.2 μs 1.34
validation-decode-stablecoin_1-3 1222 μs 894.9 μs 1.37
validation-decode-stablecoin_1-4 232.5 μs 170.1 μs 1.37
validation-decode-stablecoin_1-5 1225 μs 889.9 μs 1.38
validation-decode-stablecoin_1-6 232.7 μs 171.1 μs 1.36
validation-decode-stablecoin_2-1 1225 μs 1086 μs 1.13
validation-decode-uniswap-1 326.8 μs 306.1 μs 1.07
validation-decode-vesting-1 378.6 μs 320.5 μs 1.18
nofib-clausify/formula2 4645 μs 4284 μs 1.08
nofib-clausify/formula3 15940 μs 11720 μs 1.36
nofib-clausify/formula4 36540 μs 26860 μs 1.36
nofib-clausify/formula5 68880 μs 56700 μs 1.21
nofib-queens4x4/bjbt1 9292 μs 7533 μs 1.23
nofib-queens4x4/bjbt2 8732 μs 7567 μs 1.15
nofib-queens4x4/fc 19320 μs 13870 μs 1.39
nofib-queens5x5/bt 104300 μs 73840 μs 1.41
nofib-queens5x5/bm 108700 μs 77260 μs 1.41
nofib-queens5x5/bjbt1 92500 μs 86610 μs 1.07
marlowe-semantics/0101080808040600020306010000000302050807010208060100070207080202 1131 μs 837.5 μs 1.35
marlowe-semantics/0104010200020000040103020102020004040300030304040400010301040303 1152 μs 848.1 μs 1.36
marlowe-semantics/04000f0b04051006000e060f09080d0b090d0104050a0b0f0506070f0a070008 1101 μs 811.7 μs 1.36
marlowe-semantics/0543a00ba1f63076c1db6bf94c6ff13ae7d266dd7544678743890b0e8e1add63 1550 μs 1145 μs 1.35
marlowe-semantics/0705030002040601010206030604080208020207000101060706050502040301 1518 μs 1117 μs 1.36
marlowe-semantics/07070c070510030509010e050d00040907050e0a0d06030f1006030701020607 1514 μs 1116 μs 1.36
marlowe-semantics/0bcfd9487614104ec48de2ea0b2c0979866a95115748c026f9ec129384c262c4 1680 μs 1237 μs 1.36
marlowe-semantics/0be82588e4e4bf2ef428d2f44b7687bbb703031d8de696d90ec789e70d6bc1d8 2015.0000000000002 μs 1485 μs 1.36
marlowe-semantics/0f1d0110001b121d051e15140c0c05141d151c1f1d201c040f10091b020a0e1a 705.5 μs 518.8 μs 1.36
marlowe-semantics/119fbea4164e2bf21d2b53aa6c2c4e79414fe55e4096f5ce2e804735a7fbaf91 1128 μs 834 μs 1.35
marlowe-semantics/12910f24d994d451ff379b12c9d1ecdb9239c9b87e5d7bea570087ec506935d5 738 μs 543 μs 1.36
marlowe-semantics/18cefc240debc0fcab14efdd451adfd02793093efe7bc76d6322aed6ddb582ad 1113 μs 822.1 μs 1.35
marlowe-semantics/1a2f2540121f09321216090b2b1f211e3f020c2c133a1a3c3f3c232a26153a04 452.3 μs 332.4 μs 1.36
marlowe-semantics/1a573aed5c46d637919ccb5548dfc22a55c9fc38298d567d15ee9f2eea69d89e 1337 μs 987.5 μs 1.35
marlowe-semantics/1d56060c3b271226064c672a282663643b1b0823471c67737f0b076870331260 1161 μs 853.1 μs 1.36
marlowe-semantics/1d6e3c137149a440f35e0efc685b16bfb8052ebcf66ec4ad77e51c11501381c7 450.7 μs 332.9 μs 1.35
marlowe-semantics/1f0f02191604101e1f201016171604060d010d1d1c150e110a110e1006160a0d 1454 μs 1071 μs 1.36
marlowe-role-payout/4dd7755b6ca1f0c9747c1fc0ee4da799f6f1c07108e980bd9f820911ad711ff2 261.6 μs 248.5 μs 1.05
marlowe-role-payout/a6f064b83b31032ea7f25921364727224707268e472a569f584cc6b1d8c017e8 261 μs 191.9 μs 1.36
marlowe-role-payout/a7cb09f417c3f089619fe25b7624392026382b458486129efcff18f8912bf302 258.3 μs 189.8 μs 1.36
marlowe-role-payout/a92b4072cb8601fa697e1150c08463b14ffced54eb963df08d322216e27373cb 260.7 μs 191.3 μs 1.36
marlowe-role-payout/af2e072b5adfaa7211e0b341e1f7319c4f4e7364a4247c9247132a927e914753 304.2 μs 224.1 μs 1.36
marlowe-role-payout/b43564af5f13cc5208b92b1ad6d45369446f378d3891e5cb3e353b30d4f3fb10 260.1 μs 191.8 μs 1.36
marlowe-role-payout/b6243a5b4c353ce4852aa41705111d57867d2783eeef76f6d59beb2360da6e90 348.1 μs 256.2 μs 1.36
marlowe-role-payout/b869f3928200061abb1c3060425b9354b0e08cbf4400b340b8707c14b34317cd 376.4 μs 277.2 μs 1.36
marlowe-role-payout/bcdbc576d63b0454100ad06893812edafc2e7e4934fec1b44e2d06eb34f36eb8 261 μs 191.5 μs 1.36
marlowe-role-payout/bd460b7549b70c52e37b312a4242041eac18fe4a266f018bcea0c78a9085a271 297.1 μs 218.3 μs 1.36
marlowe-role-payout/ee3962fbd7373360f46decef3c9bda536a0b1daf6cda3b8a4bcfd6deeb5b4c53 238.2 μs 218 μs 1.09
marlowe-role-payout/f1a1e6a487f91feca5606f72bbb1e948c71abf043c6a0ea83bfea9ec6a0f08d8 257.8 μs 190 μs 1.36
marlowe-role-payout/f2932e4ca4bbb94b0a9ffbe95fcb7bd5639d9751d75d56d5e14efa5bbed981df 256.1 μs 188.6 μs 1.36
marlowe-role-payout/f53e8cafe26647ccce51e4c31db13608aea1f39034c0f52dee2e5634ef66e747 282.6 μs 208.1 μs 1.36
marlowe-role-payout/f7275afb60e33a550df13a132102e7e925dd28965a4efbe510a89b077ff9417f 260.1 μs 191.8 μs 1.36
marlowe-role-payout/fc8c5f45ffcdb024c21e0f34b22c23de8045a94d5e1a5bda1555c45ddb059f82 269.8 μs 198.2 μs 1.36
marlowe-role-payout/ff38b1ec89952d0247630f107a90cbbeb92ecbfcd19b284f60255718e4ec7548 308.4 μs 226.4 μs 1.36

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

CC: @IntersectMBO/plutus-core

Please sign in to comment.