Updating performance test.

This commit is contained in:
Dessalines 2018-12-02 11:48:26 -07:00
parent 0b570e6249
commit 7569fbf341
1 changed files with 18 additions and 4 deletions

View File

@ -1,22 +1,30 @@
#!/bin/bash #!/bin/bash
touch test.db
# Remove quotes # Remove quotes
sed 's/\"//g' ../torrents.csv > torrents_removed_quotes.csv sed 's/\"//g' ../torrents.csv > torrents_removed_quotes.csv
sqlite3 -batch test.db <<"EOF" sqlite3 -batch test.db <<"EOF"
create table torrents (); create table torrents(
"infohash" TEXT,
"name" TEXT,
"size_bytes" INTEGER,
"created_unix" INTEGER,
"seeders" INTEGER,
"leechers" INTEGER,
"completed" INTEGER,
"scraped_date" INTEGER
);
.separator ";" .separator ";"
.import torrents_removed_quotes.csv torrents .import torrents_removed_quotes.csv torrents
create index name_index on torrents (name); UPDATE torrents SET completed=NULL WHERE completed = '';
EOF EOF
echo "Ripgrep time for pearl jam" echo "Ripgrep time for pearl jam"
time rg -i "pearl.*jam" ../torrents.csv > /dev/null time rg -i "pearl.*jam" ../torrents.csv > /dev/null
echo "Sqlite3 time" echo "Sqlite3 time"
time sqlite3 test.db "select * from torrents where name like '%pearl%jam%fix%' limit 10" > /dev/null time sqlite3 test.db "select * from torrents where name like '%pearl%jam%' limit 10" > /dev/null
echo "Ripgrep time for avengers infinity" echo "Ripgrep time for avengers infinity"
time rg -i "avengers.*infinity" ../torrents.csv > /dev/null time rg -i "avengers.*infinity" ../torrents.csv > /dev/null
@ -36,5 +44,11 @@ time rg -i "prestige.*2006" ../torrents.csv > /dev/null
echo "Sqlite3 time" echo "Sqlite3 time"
time sqlite3 test.db "select * from torrents where name like '%prestige%2006%' limit 10" > /dev/null time sqlite3 test.db "select * from torrents where name like '%prestige%2006%' limit 10" > /dev/null
echo "Ripgrep time for why"
time rg -i "w" ../torrents.csv > /dev/null
echo "Sqlite3 time"
time sqlite3 test.db "select * from torrents where name like '%why%' limit 10" > /dev/null
rm test.db rm test.db
rm torrents_removed_quotes.csv rm torrents_removed_quotes.csv