File: bench-memory.sh

package info (click to toggle)
aws-crt-python 0.20.4%2Bdfsg-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 72,656 kB
  • sloc: ansic: 381,805; python: 23,008; makefile: 6,251; sh: 4,536; cpp: 699; ruby: 208; java: 77; perl: 73; javascript: 46; xml: 11
file content (30 lines) | stat: -rwxr-xr-x 963 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash

# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0

# Benches memory usage for all possible configurations and generate plots in images/
# All given arguments (ex. `--config aws-lc-config/s2n.toml` to use AWS-LC) are passed to Cargo

set -e

pushd "$(dirname "$0")"/.. > /dev/null

cargo build --release --features memory --bin memory --bin graph_memory "$@"

# iterate through all possible options
for reuse_config in false true
do
    for shrink_buffers in false true
    do
        for bench_target in client server pair
        do
            valgrind --tool=massif --depth=1 --massif-out-file="target/memory/massif.out" --time-unit=ms target/release/memory $bench_target --reuse-config $reuse_config --shrink-buffers $shrink_buffers
            rm target/memory/massif.out
        done
    done
done

cargo run --release --features memory --bin graph_memory "$@"

popd > /dev/null