Skip to content

Instantly share code, notes, and snippets.

@daose
Created May 27, 2019 02:30
Show Gist options
  • Save daose/7e454e0cdb977a10d590a614580cee0a to your computer and use it in GitHub Desktop.
Save daose/7e454e0cdb977a10d590a614580cee0a to your computer and use it in GitHub Desktop.
benchmark.sh
#!/bin/bash
echo --- Deleting
rm -f *.jav
rm -f *.class
echo --- Compiling
javac *.java
if [ $? -ne 0 ]; then
exit
fi
echo --- Running
echo ------TINY
taskset -c 0,1 java -Xmx1g CCServer 18999 &
java -Xmx1g CCClient localhost 18999 sample_input/tiny.txt my_tiny.txt
kill $!
java Compare my_tiny.txt sample_output/tiny.out
echo ------SMALL
taskset -c 0,1 java -Xmx1g CCServer 18998 &
java -Xmx1g CCClient localhost 18998 sample_input/small.txt my_small.txt
kill $!
java Compare my_small.txt sample_output/small.out
echo ------MEDIUM
taskset -c 0,1 java -Xmx1g CCServer 18997 &
java -Xmx1g CCClient localhost 18997 sample_input/medium.txt my_medium.txt
kill $!
java Compare my_medium.txt sample_output/medium.out
echo ------LARGE
taskset -c 0,1 java -Xmx1g CCServer 18996 &
java -Xmx1g CCClient localhost 18996 sample_input/large.txt my_large.txt
kill $!
java Compare my_large.txt sample_output/large.out
echo ------HUGE
taskset -c 0,1 java -Xmx1g CCServer 18995 &
java -Xmx1g CCClient localhost 18995 sample_input/huge.txt my_huge.txt
kill $!
java Compare my_huge.txt sample_output/huge.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment