-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbenchmark.sh
executable file
·72 lines (48 loc) · 3.79 KB
/
benchmark.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -eo pipefail
output="benchmark.csv"
echo "config,libuniffi_yttrium.so.arm64-v8a,libuniffi_yttrium.so.armeabi-v7a" > $output
export ENABLE_STRIP="false"
export PROFILE="uniffi-release"
# ./build-kotlin.sh
# echo "kotlin/$PROFILE/nostrip,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export PROFILE="uniffi-release-v2"
# ./build-kotlin.sh
# echo "kotlin/$PROFILE/nostrip,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export ENABLE_STRIP="true"
export PROFILE="uniffi-release"
# ./build-kotlin.sh
# echo "kotlin/$PROFILE,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export PROFILE="uniffi-release-v2"
# ./build-kotlin.sh
# echo "kotlin/$PROFILE,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export PROFILE="kotlin-release-next"
# ./build-kotlin.sh
# echo "kotlin/$PROFILE,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export CARGO_FLAGS="+nightly"
# ./build-kotlin.sh
# echo "kotlin/$PROFILE/nightly,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export CARGO_NDK_FLAGS="-Z build-std=std,panic_abort -Z build-std-features=optimize_for_size"
# TARGET_DIR="target/kotlin-build/$PROFILE/stdo" ./build-kotlin.sh
# echo "kotlin/$PROFILE/stdo,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export CARGO_RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none"
# TARGET_DIR="target/kotlin-build/$PROFILE/stdo-dld-nfd" ./build-kotlin.sh
# echo "kotlin/$PROFILE/stdo-dld-nfd,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export CARGO_NDK_FLAGS="-Z build-std=std,panic_abort -Z build-std-features=optimize_for_size,panic_immediate_abort"
# TARGET_DIR="target/kotlin-build/$PROFILE/stdo-dld-nfd-pia" ./build-kotlin.sh
# echo "kotlin/$PROFILE/stdo-nld-nfd-pia,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
export UNIFFI_OMIT_CHECKSUMS="true"
# TARGET_DIR="target/kotlin-build/$PROFILE/stdo-dld-nfd-pia-nuc" ./build-kotlin.sh
# echo "kotlin/$PROFILE/stdo-nld-nfd-pia-nuc,$(cat benchmark/build-kotlin/$PROFILE/arm64-v8a/libuniffi_yttrium.so.size),$(cat benchmark/build-kotlin/$PROFILE/armeabi-v7a/libuniffi_yttrium.so.size)" >> benchmark.csv
echo "Building Swift"
# TODO Swift
echo "Building WASM"
output="benchmark-wasm.csv"
echo "config,yttrium_bg.wasm.web,yttrium_bg.wasm.nodejs" > $output
# ./build-wasm.sh
WASM_FLAGS="--profiling" ./build-wasm.sh
echo "wasm/normal,$(cat benchmark/build-wasm/web/yttrium_bg.wasm.size),$(cat benchmark/build-wasm/nodejs/yttrium_bg.wasm.size)" >> $output
# WASM_FLAGS="--release" ./build-wasm.sh
# echo "wasm/release,$(cat benchmark/build-wasm/web/yttrium_bg.wasm.size),$(cat benchmark/build-wasm/nodejs/yttrium_bg.wasm.size)" >> $output
# WASM_FLAGS="--dev" ./build-wasm.sh
# echo "wasm/dev,$(cat benchmark/build-wasm/web/yttrium_bg.wasm.size),$(cat benchmark/build-wasm/nodejs/yttrium_bg.wasm.size)" >> $output