Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

partition ranges, covering indexes, smarter iterators #1116

Merged
merged 13 commits into from
Dec 16, 2020
Prev Previous commit
Next Next commit
perf comparison script
  • Loading branch information
Brian Hendriks committed Dec 15, 2020
commit 628ec20f50905e5d864302127eb0e9654b5d4ddf
51 changes: 51 additions & 0 deletions benchmark/perf_tools/python/compare_perf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import sys
import csv

from math import fabs

def average_time(row):
return float(row['latency_sum']) / float(row['sql_transactions'])

def read_result_data(filename, tests):
mysql_result_data = {}
dolt_result_data = {}
with open(filename) as f:
csvr = csv.DictReader(f)
for row in csvr:
test_name = row['test_name']
if 'all' in tests or test_name in tests:
if row['database'] == 'dolt':
dolt_result_data[test_name] = average_time(row)
else:
mysql_result_data[test_name] = average_time(row)

return mysql_result_data, dolt_result_data

initial_result_file = sys.argv[1]
updated_result_file = sys.argv[2]
test_names = sys.argv[3] if len(sys.argv) >= 4 else "all"

initial_mysql, initial_dolt = read_result_data(initial_result_file, test_names)
updated_mysql, updated_dolt = read_result_data(updated_result_file, test_names)

print("initial mysql", initial_mysql, "initial dolt", initial_dolt)
print("updated mysql", updated_mysql, "updated dolt", updated_dolt)
for name, time in initial_dolt.items():
if name in updated_dolt:
updated_time = updated_dolt[name]
delta = time - updated_time
initial_mysql_multiplier = time / initial_mysql[name]
updated_mysql_multiplier = updated_time / updated_mysql[name]
percent_change = 1.0 - (updated_time / time)
faster_slower = "faster" if percent_change > 0.0 else "slower"

print("% -24s: %.2f%% %s - mysql multiplier: %.2fx -> %.02fx" % (name, fabs(percent_change)*100, faster_slower, initial_mysql_multiplier, updated_mysql_multiplier))
else:
print("% -24s: %4.4f - Test removed from updated result file" % (name, float(time)))

for name, time in updated_dolt.items():
if name not in initial_dolt:
print("% -24s: %4.4f - New test addeed to updated result file" % (name, float(time)))