#!/bin/bash

function do_load_save()
{
    python baseline.py > /dev/null
}

function do_search()
{
    python test.py test > ./output.txt
}

function do_load_save_sql()
{
    python baselinesql.py > /dev/null
}

function do_search_sql()
{
    python testsql.py test > ./outputsql.txt
}

echo "Calculating time to load and save the phonelist with old"
time do_load_save

echo "Calculating time to search the phonelist with old (including time to load and save it)"
time do_search

echo "Calculating time to load and save the phonelist with sql"
time do_load_save_sql

echo "Calculating time to search the phonelist with sql (including time to load and save it)"
time do_search_sql


diff -du ./output.txt ./outputsql.txt
rm -rf ./output.txt ./outputsql.txt


