From 7569fbf3412cfd8147933085ac1da91eb02cee78 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Sun, 2 Dec 2018 11:48:26 -0700 Subject: [PATCH] Updating performance test. --- scripts/sqlite_performance_test.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/sqlite_performance_test.sh b/scripts/sqlite_performance_test.sh index 9520c6f..3e760a0 100755 --- a/scripts/sqlite_performance_test.sh +++ b/scripts/sqlite_performance_test.sh @@ -1,22 +1,30 @@ #!/bin/bash -touch test.db # Remove quotes sed 's/\"//g' ../torrents.csv > torrents_removed_quotes.csv 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 ";" .import torrents_removed_quotes.csv torrents -create index name_index on torrents (name); +UPDATE torrents SET completed=NULL WHERE completed = ''; EOF echo "Ripgrep time for pearl jam" time rg -i "pearl.*jam" ../torrents.csv > /dev/null 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" 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" 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 torrents_removed_quotes.csv \ No newline at end of file