summaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-19 14:50:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-19 14:50:39 +0000
commitf2981e8e4d28233864f1ca06ecec45ab80bf9eae (patch)
treeb70cb633916830138ce3424aa361f0bbaff02be2 /benchmarks
parentReleasing debian version 10.0.1-1. (diff)
downloadsqlglot-f2981e8e4d28233864f1ca06ecec45ab80bf9eae.tar.xz
sqlglot-f2981e8e4d28233864f1ca06ecec45ab80bf9eae.zip
Merging upstream version 10.0.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/bench.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/benchmarks/bench.py b/benchmarks/bench.py
index cef62a8..2475608 100644
--- a/benchmarks/bench.py
+++ b/benchmarks/bench.py
@@ -5,8 +5,10 @@ collections.Iterable = collections.abc.Iterable
import gc
import timeit
-import moz_sql_parser
import numpy as np
+
+import sqlfluff
+import moz_sql_parser
import sqloxide
import sqlparse
import sqltree
@@ -177,6 +179,10 @@ def sqloxide_parse(sql):
sqloxide.parse_sql(sql, dialect="ansi")
+def sqlfluff_parse(sql):
+ sqlfluff.parse(sql)
+
+
def border(columns):
columns = " | ".join(columns)
return f"| {columns} |"
@@ -193,6 +199,7 @@ def diff(row, column):
libs = [
"sqlglot",
+ "sqlfluff",
"sqltree",
"sqlparse",
"moz_sql_parser",
@@ -206,7 +213,8 @@ for name, sql in {"tpch": tpch, "short": short, "long": long, "crazy": crazy}.it
for lib in libs:
try:
row[lib] = np.mean(timeit.repeat(lambda: globals()[lib + "_parse"](sql), number=3))
- except:
+ except Exception as e:
+ print(e)
row[lib] = "error"
columns = ["Query"] + libs