Skip to content

Commit

Permalink
Build also with --no-default-features in report-size-overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
jirutka committed Apr 17, 2023
1 parent ddbca51 commit 212c228
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/report-size-overhead
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,24 @@ build_and_report() (
size1=$(file_size "$OUT_DIR/argparse_rosetta_argp")
rm "$OUT_DIR/argparse_rosetta_argp"

cargo build --release --example argparse_rosetta_argp --no-default-features
size2=$(file_size "$OUT_DIR/argparse_rosetta_argp")
rm "$OUT_DIR/argparse_rosetta_argp"

cargo build --release --example subcommands
size2=$(file_size "$OUT_DIR/subcommands")
size3=$(file_size "$OUT_DIR/subcommands")
rm "$OUT_DIR/subcommands"

echo "| $(diff_kb $size0 0) kiB | +$(diff_kb $size1 $size0) kiB | +$(diff_kb $size2 $size0) kiB | $*" >> "$REPORT_OUT"
echo "| $(diff_kb $size0 0) kiB | +$(diff_kb $size1 $size0) kiB | +$(diff_kb $size2 $size0) kiB | +$(diff_kb $size3 $size0) kiB | $*" >> "$REPORT_OUT"
)

REPORT_OUT="$(mktemp)"

cat > "$REPORT_OUT" <<EOF
argp size overhead:
| baseline | rosetta | subcommands | build options
|----------|---------|-------------|--------------
| baseline | rosetta | rosetta* | subcommands | build options
|----------|---------|----------|-------------|--------------
EOF

build_and_report opt-level=2
Expand All @@ -69,4 +73,8 @@ build_and_report opt-level=s lto=fat panic=abort

echo ''
cat "$REPORT_OUT"
cat <<EOF
* with --no-default-features
EOF
rm -f "$REPORT_OUT"

0 comments on commit 212c228

Please sign in to comment.