Skip to content

Instantly share code, notes, and snippets.

@acecilia
Created May 23, 2020 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acecilia/2a951b472685c75e2687a95912fb9d46 to your computer and use it in GitHub Desktop.
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/
#!/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