2018-12-19 11:18:23 +08:00
|
|
|
#!/bin/bash
|
2018-12-19 11:21:19 +08:00
|
|
|
[[ "$(command -v gnuplot)" ]] || { echo "gnuplot is not installed" 1>&2 ; exit 1; }
|
2018-12-19 11:18:23 +08:00
|
|
|
|
|
|
|
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
|
|
|
|
cd $SCRIPTPATH/..
|
|
|
|
plotdirectory=$SCRIPTPATH/plots/$(uname -n)
|
|
|
|
mkdir -p $plotdirectory
|
|
|
|
|
|
|
|
os=$(uname)
|
|
|
|
|
2018-12-19 11:21:19 +08:00
|
|
|
|
2018-12-19 11:18:23 +08:00
|
|
|
if [ "$os" = "Linux" ]; then
|
|
|
|
echo "You are using linux."
|
|
|
|
echo "We are going to just parse using simdjson, and collect perf stats."
|
|
|
|
|
2018-12-20 10:23:37 +08:00
|
|
|
make parse parse_noutf8validation parse_nonumberparsing parse_nostringparsing
|
2018-12-19 11:48:24 +08:00
|
|
|
myfile=$plotdirectory"/parselinuxtable.txt"
|
|
|
|
echo $myfile
|
|
|
|
echo "" > $myfile
|
2018-12-20 10:23:37 +08:00
|
|
|
|
|
|
|
myfile_noutf8validation=$plotdirectory"/parselinuxtable_noutf8validation.txt"
|
|
|
|
echo $myfile_noutf8validation
|
|
|
|
echo "" > $myfile_noutf8validation
|
|
|
|
|
|
|
|
myfile=$plotdirectory"/parselinuxtable_nonumberparsing.txt"
|
|
|
|
echo $myfile_nonumberparsing
|
|
|
|
echo "" > $myfile_nonumberparsing
|
|
|
|
|
|
|
|
myfile=$plotdirectory"/parselinuxtable_nostringparsing.txt"
|
|
|
|
echo $myfile_nostringparsing
|
|
|
|
echo "" > $myfile_nostringparsing
|
|
|
|
|
|
|
|
|
2018-12-19 11:18:23 +08:00
|
|
|
for i in $SCRIPTPATH/../jsonexamples/*.json; do
|
|
|
|
[ -f "$i" ] || break
|
|
|
|
echo $i
|
2018-12-19 11:48:24 +08:00
|
|
|
$SCRIPTPATH/../parse -t "$i" >> "$myfile"
|
2018-12-20 10:23:37 +08:00
|
|
|
$SCRIPTPATH/../parse_noutf8validation -t "$i" >> "$myfile_noutf8validation"
|
|
|
|
$SCRIPTPATH/../parse_nonumberparsing -t "$i" >> "$myfile_nonumberparsing"
|
|
|
|
$SCRIPTPATH/../parse_nostringparsing -t "$i" >> "$myfile_nostringparsing"
|
2018-12-19 11:18:23 +08:00
|
|
|
done
|
2018-12-20 10:23:37 +08:00
|
|
|
paste $myfile $myfile_noutf8validation $myfile_nonumberparsing $myfile_nostringparsing > $myfile.tmp
|
|
|
|
mv $myfile.tmp $myfile
|
|
|
|
rm $myfile_noutf8validation $myfile_nonumberparsing $myfile_nostringparsing
|
2018-12-19 11:58:26 +08:00
|
|
|
gnuplot -e "filename='$myfile';name='$plotdirectory/stackedperf.pdf'" $SCRIPTPATH/stackbar.gnuplot
|
2018-12-19 11:18:23 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
make parsingcompetition
|
|
|
|
echo "parsing (with competition)"
|
|
|
|
echo
|
|
|
|
for i in $SCRIPTPATH/../jsonexamples/*.json; do
|
|
|
|
[ -f "$i" ] || break
|
|
|
|
echo $i
|
|
|
|
shortname=$(basename $SCRIPTPATH/$i.table)
|
|
|
|
corename=$(basename ${shortname%.*})".pdf"
|
|
|
|
$SCRIPTPATH/../parsingcompetition -t $i > $plotdirectory/$shortname
|
|
|
|
sort $plotdirectory/$shortname > $plotdirectory/$shortname.table.sorted
|
|
|
|
gnuplot -e "filename='$plotdirectory/$shortname.table.sorted';name='$plotdirectory/$corename'" $SCRIPTPATH/bar.gnuplot
|
|
|
|
rm $plotdirectory/$shortname
|
|
|
|
rm $plotdirectory/$shortname.table.sorted
|
|
|
|
echo
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
make parseandstatcompetition
|
|
|
|
echo "parsing and collecting basic stats on json documents as quickly as possible"
|
|
|
|
echo
|
|
|
|
for i in $SCRIPTPATH/../jsonexamples/*.json; do
|
|
|
|
[ -f "$i" ] || break
|
|
|
|
echo $i
|
|
|
|
shortname=$(basename $SCRIPTPATH/$i"parseandstat.table")
|
|
|
|
corename=$(basename ${shortname%.*})".pdf"
|
|
|
|
$SCRIPTPATH/../parseandstatcompetition -t $i> $plotdirectory/$shortname
|
|
|
|
sort $plotdirectory/$shortname > $plotdirectory/$shortname.table.sorted
|
|
|
|
gnuplot -e "filename='$plotdirectory/$shortname.table.sorted';name='$plotdirectory/$corename'" $SCRIPTPATH/bar.gnuplot
|
|
|
|
rm $plotdirectory/$shortname
|
|
|
|
rm $plotdirectory/$shortname.table.sorted
|
|
|
|
echo
|
|
|
|
done
|
|
|
|
|
|
|
|
make distinctuseridcompetition
|
|
|
|
echo "parsing and finding all user.id"
|
|
|
|
echo
|
|
|
|
|
|
|
|
for i in $SCRIPTPATH/../jsonexamples/twitter.json; do
|
|
|
|
[ -f "$i" ] || break
|
|
|
|
echo $i
|
|
|
|
shortname=$(basename $SCRIPTPATH/$i"distinctuserid.table")
|
|
|
|
corename=$(basename ${shortname%.*})".pdf"
|
|
|
|
$SCRIPTPATH/../distinctuseridcompetition -t jsonexamples/twitter.json> $plotdirectory/$shortname
|
|
|
|
sort $plotdirectory/$shortname > $plotdirectory/$shortname.table.sorted
|
|
|
|
gnuplot -e "filename='$plotdirectory/$shortname.table.sorted';name='$plotdirectory/$corename'" $SCRIPTPATH/bar.gnuplot
|
|
|
|
rm $plotdirectory/$shortname
|
|
|
|
rm $plotdirectory/$shortname.table.sorted
|
|
|
|
echo
|
|
|
|
done
|
|
|
|
|
2018-12-19 11:48:24 +08:00
|
|
|
echo "see results in "$plotdirectory
|