summaryrefslogtreecommitdiffstats
path: root/benchmarks/bench.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-02-08 05:38:42 +0000
commitc66e4a33e1a07c439f03fe47f146a6c6482bf6df (patch)
treecfdf01111c063b3e50841695e6c2768833aea4dc /benchmarks/bench.py
parentReleasing debian version 20.11.0-1. (diff)
downloadsqlglot-c66e4a33e1a07c439f03fe47f146a6c6482bf6df.tar.xz
sqlglot-c66e4a33e1a07c439f03fe47f146a6c6482bf6df.zip
Merging upstream version 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)