Skip to content

Fix performance test script #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions scripts/performance_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##
## This source file is part of the SwiftAWSLambdaRuntime open source project
##
## Copyright (c) 2017-2018 Apple Inc. and the SwiftAWSLambdaRuntime project authors
## Copyright (c) 2017-2022 Apple Inc. and the SwiftAWSLambdaRuntime project authors
## Licensed under Apache License v2.0
##
## See LICENSE.txt for license information
Expand All @@ -27,6 +27,8 @@ if [[ $(uname -s) == "Linux" ]]; then
fi

swift build -c release -Xswiftc -g
swift build --package-path Examples/Echo -c release -Xswiftc -g
swift build --package-path Examples/JSON -c release -Xswiftc -g

cleanup() {
kill -9 $server_pid
Expand Down Expand Up @@ -58,7 +60,7 @@ cold=()
export MAX_REQUESTS=1
for (( i=0; i<$cold_iterations; i++ )); do
start=$(gdate +%s%N)
./.build/release/StringSample
./Examples/Echo/.build/release/MyLambda
end=$(gdate +%s%N)
cold+=( $(($end-$start)) )
done
Expand All @@ -70,7 +72,7 @@ results+=( "$MODE, cold: $avg_cold (ns)" )
echo "running $MODE mode warm test"
export MAX_REQUESTS=$warm_iterations
start=$(gdate +%s%N)
./.build/release/StringSample
./Examples/Echo/.build/release/MyLambda
end=$(gdate +%s%N)
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
Expand All @@ -96,7 +98,7 @@ cold=()
export MAX_REQUESTS=1
for (( i=0; i<$cold_iterations; i++ )); do
start=$(gdate +%s%N)
./.build/release/CodableSample
./Examples/JSON/.build/release/MyLambda
end=$(gdate +%s%N)
cold+=( $(($end-$start)) )
done
Expand All @@ -108,7 +110,7 @@ results+=( "$MODE, cold: $avg_cold (ns)" )
echo "running $MODE mode warm test"
export MAX_REQUESTS=$warm_iterations
start=$(gdate +%s%N)
./.build/release/CodableSample
./Examples/JSON/.build/release/MyLambda
end=$(gdate +%s%N)
sum_warm=$(($end-$start-$avg_cold)) # substract by avg cold since the first call is cold
avg_warm=$(($sum_warm/($warm_iterations-1))) # substract since the first call is cold
Expand Down
2 changes: 1 addition & 1 deletion scripts/soundness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

function replace_acceptable_years() {
# this needs to replace all acceptable forms with 'YEARS'
sed -e 's/2017-2018/YEARS/' -e 's/2017-2020/YEARS/' -e 's/2017-2021/YEARS/' -e 's/2020-2021/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/' -e 's/2021/YEARS/' -e 's/2022/YEARS/'
sed -e 's/2017-2018/YEARS/' -e 's/2017-2020/YEARS/' -e 's/2017-2021/YEARS/' -e 's/2017-2022/YEARS/' -e 's/2020-2021/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/' -e 's/2021/YEARS/' -e 's/2022/YEARS/'
}

printf "=> Checking for unacceptable language... "
Expand Down