Skip to content

Commit

Permalink
Simplify speedy benchmark
Browse files Browse the repository at this point in the history
This PR drops two things:

1. The check that the benchmark hasn’t been modified. This hasn’t ever
been useful and it keeps being annoying.
2. It stops the comparison against the old version and instead just
benchmarks the current version. We really only care about the day to
day changes. Comparing against an arbitrary year old version has lost
all meaning at this point.

changelog_begin
changelog_end
  • Loading branch information
cocreature committed Jun 22, 2021
1 parent 8558c73 commit 17a737a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 227 deletions.
24 changes: 0 additions & 24 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,6 @@ pr: none
jobs:
- template: ci/build.yml

- job: check_perf_test
pool:
name: ubuntu_20_04
demands: assignment -equals default
steps:
- bash: |
TEST_SHA=$(cat ci/cron/perf/test_sha)
LAST_CHANGES=$(git log -n1 --format=%H daml-lf/scenario-interpreter/src/perf)
CURRENT_SHA=$(git rev-parse HEAD)
if [ "$TEST_SHA" != "$LAST_CHANGES" ]; then
if [ "$LAST_CHANGES" = "$CURRENT_SHA" ]; then
curl -XPOST \
-i \
-H 'Content-Type: application/json' \
--data "{\"text\":\"<!here> Perf tests seem to have changed. Please manually check:\n\`\`\`\ngit diff $TEST_SHA $LAST_CHANGES -- daml-lf/scenario-interpreter/src/perf\n\`\`\`\nand update accordingly. If the change is benign, update \`ci/cron/perf/test_sha\` to \`$LAST_CHANGES\`. With no intervention, you will no longer get performance reports.\"}" \
$(Slack.ci-failures-daml)
else
echo "Changes detected, but not from this commit."
fi
else
echo "No change detected."
fi
displayName: check perf changes
- job: release
dependsOn: [ "check_for_release", "Linux", "macOS", "Windows" ]
condition: and(succeeded(),
Expand Down
20 changes: 6 additions & 14 deletions ci/cron/daily-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,17 @@ jobs:
eval "$(dev-env/bin/dade assist)"
source $(bash_lib)
BASELINE="cebc26af88efef4a7c81c62b0c14353f829b755e"
TEST_SHA=$(cat ci/cron/perf/test_sha)
OUT="$(Build.StagingDirectory)/perf-results.json"
START=$(date -u +%Y%m%d_%H%M%SZ)
if git diff --exit-code $TEST_SHA -- daml-lf/scenario-interpreter/src/perf >&2; then
# no changes, all good
ci/cron/perf/compare.sh $BASELINE > "$OUT"
cat "$OUT"
else
# the tests have changed, we need to figure out what to do with
# the baseline.
echo "Baseline no longer valid, needs manual correction." > "$OUT"
fi
ci/cron/perf/bench.sh > "$OUT"
cat $OUT
gcs "$GCRED" cp "$OUT" gs://daml-data/perf/speedy/$START.json
setvar speedup "$(jq -r '.speedup' "$OUT")"
setvar speedy_perf "$(jq -r '.current-perf' "$OUT")"
displayName: measure perf
name: out
Expand Down Expand Up @@ -329,7 +321,7 @@ jobs:
compatibility: $[ dependencies.compatibility.result ]
compatibility_windows: $[ dependencies.compatibility_windows.result ]
perf_speedy: $[ dependencies.perf_speedy.result ]
speedup: $[ dependencies.perf_speedy.outputs['out.speedup'] ]
speedy_perf: $[ dependencies.perf_speedy.outputs['out.speedy_perf'] ]
perf_http_json: $[ dependencies.perf_http_json.result ]
check_releases: $[ dependencies.check_releases.result ]
blackduck_scan: $[ dependencies.blackduck_scan.result ]
Expand All @@ -355,7 +347,7 @@ jobs:
&& "$(check_releases)" == "Succeeded"
&& ("$(blackduck_scan)" == "Succeeded" || "$(blackduck_scan)" == "Skipped")
&& ("$(run_notices_pr_build)" == "Succeeded" || "$(run_notices_pr_build)" == "Skipped") ]]; then
tell_slack "Daily tests passed: $COMMIT_LINK (speedup: $(speedup))." "$(Slack.ci-failures-daml)"
tell_slack "Daily tests passed: $COMMIT_LINK (speedy_perf: $(speedy_perf))." "$(Slack.ci-failures-daml)"
else
tell_slack "Daily tests failed: $COMMIT_LINK." "$(Slack.ci-failures-daml)"
fi
15 changes: 0 additions & 15 deletions ci/cron/perf/BazelExclusiveSandboxing.patch

This file was deleted.

135 changes: 0 additions & 135 deletions ci/cron/perf/CollectAuthority.scala.patch

This file was deleted.

23 changes: 23 additions & 0 deletions ci/cron/perf/bench.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

#!/usr/bin/env bash

set -euox pipefail

measure() {
local out=$(mktemp -d)/out.json
bazel run daml-lf/scenario-interpreter:scenario-perf -- -rf json -rff $out >&2
cat $out | jq '.[0].primaryMetric.score'
}

main() {
local current=$(git rev-parse HEAD)

local current_perf=$(measure)
if [ "" = "$current_perf" ]; then exit 1; fi

echo '{"current-perf": '$current_perf', "current-sha": "'$current'"}'
}

main
38 changes: 0 additions & 38 deletions ci/cron/perf/compare.sh

This file was deleted.

1 change: 0 additions & 1 deletion ci/cron/perf/test_sha

This file was deleted.

0 comments on commit 17a737a

Please sign in to comment.