Created
May 23, 2020 15:01
-
-
Save acecilia/2a951b472685c75e2687a95912fb9d46 to your computer and use it in GitHub Desktop.
Script to demonstrate notarization requests on executing shell scripts: https://sigpipe.macromates.com/2020/macos-catalina-slow-by-design/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf /tmp/speed_test | |
mkdir -p /tmp/speed_test | |
TIMEFORMAT="%R" | |
first_execution_time=0 | |
second_execution_time=0 | |
for i in {1..100};do | |
FILENAME=$(openssl rand -hex 10) | |
echo $'#!/bin/sh\necho Hello' > "/tmp/speed_test/$FILENAME.sh" | |
chmod a+x "/tmp/speed_test/$FILENAME.sh" | |
FILE="/tmp/speed_test/$FILENAME.sh" | |
first=`(time $FILE > /dev/null) 2>&1` | |
first_execution_time=$(echo "$first_execution_time + $first" | bc) | |
second=`(time $FILE > /dev/null) 2>&1` | |
second_execution_time=$(echo "$second_execution_time + $second" | bc) | |
done | |
echo "First time execution: $first_execution_time" | |
echo "Second time execution: $second_execution_time" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment