summaryrefslogtreecommitdiffstats
path: root/benchmarks/bench.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:39 +0000
commitaedf35026379f52d7e2b4c1f957691410a758089 (patch)
tree86540364259b66741173d2333387b78d6f9c31e2 /benchmarks/bench.py
parentAdding upstream version 20.11.0. (diff)
downloadsqlglot-aedf35026379f52d7e2b4c1f957691410a758089.tar.xz
sqlglot-aedf35026379f52d7e2b4c1f957691410a758089.zip
Adding upstream version 21.0.1.upstream/21.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'benchmarks/bench.py')
-rw-r--r--benchmarks/bench.py29
1 files changed, 15 insertions, 14 deletions
diff --git a/benchmarks/bench.py b/benchmarks/bench.py
index 10b04b5..917266d 100644
--- a/benchmarks/bench.py
+++ b/benchmarks/bench.py
@@ -2,15 +2,14 @@ import collections.abc
# moz_sql_parser 3.10 compatibility
collections.Iterable = collections.abc.Iterable
-import gc
import timeit
import numpy as np
-#import sqlfluff
-#import moz_sql_parser
-#import sqloxide
-#import sqlparse
+# import sqlfluff
+# import moz_sql_parser
+# import sqloxide
+# import sqlparse
import sqltree
import sqlglot
@@ -170,7 +169,7 @@ def sqlglotrs_parse(sql):
def sqltree_parse(sql):
- sqltree.api.sqltree(sql.replace('"', '`').replace("''", '"'))
+ sqltree.api.sqltree(sql.replace('"', "`").replace("''", '"'))
def sqlparse_parse(sql):
@@ -206,11 +205,11 @@ def diff(row, column):
libs = [
"sqlglot",
"sqlglotrs",
- #"sqlfluff",
+ # "sqlfluff",
"sqltree",
- #"sqlparse",
- #"moz_sql_parser",
- #"sqloxide",
+ # "sqlparse",
+ # "moz_sql_parser",
+ # "sqloxide",
]
table = []
@@ -231,10 +230,12 @@ lines = [border(column.rjust(width) for column, width in widths.items())]
lines.append(border(str("-" * width) for width in widths.values()))
for i, row in enumerate(table):
- lines.append(border(
- (str(row[column])[0:7] + diff(row, column)).rjust(width)[0 : width]
- for column, width in widths.items()
- ))
+ lines.append(
+ border(
+ (str(row[column])[0:7] + diff(row, column)).rjust(width)[0:width]
+ for column, width in widths.items()
+ )
+ )
for line in lines:
print(line)