Skip to content

Commit d90423d

Browse files
committed
Fix parsing of timing info
1 parent 6a74905 commit d90423d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

backend/backend.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,15 @@ def run_sql_query(query_str, db):
6767
splitted = output.split("\n")
6868
header_list = splitted[-2].split()
6969
times_list = splitted[-1].split()
70-
times_dict = {}
71-
72-
for i in range(len(header_list)):
73-
if header_list[i] != 'name':
74-
times_dict[header_list[i]] = float(times_list[i])
70+
query_opt_time=float(times_list[1])
71+
execution_time=float(times_list[-1])
72+
compilation_time = sum(float(t) for t in times_list[2:-1])
7573
result = "\n".join(splitted[1:-4])
7674
table_as_json = table_to_json(raw_table=result)
7775
return {"result": table_as_json, "timing": {
78-
"compilation": sum([times_dict[t] for t in
79-
["lowerRelAlg", "lowerSubOp", "lowerDB", "lowerArrow", "lowerToLLVM", "toLLVMIR",
80-
"llvmOptimize", "llvmCodeGen"]]),
81-
"execution": times_dict["executionTime"],
82-
"qopt": times_dict["QOpt"],
76+
"compilation": compilation_time,
77+
"execution": execution_time,
78+
"qopt": query_opt_time
8379
}}
8480

8581
except subprocess.CalledProcessError as e:

0 commit comments

Comments
 (0)