Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions hyper-parquet/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@

query = sys.stdin.read()

for try_num in range(3):
if try_num == 0:
# Flush OS page cache before first run of each query
subprocess.run(['sync'], check=True)
subprocess.run(['sudo', 'tee', '/proc/sys/vm/drop_caches'], input=b'3', check=True, stdout=subprocess.DEVNULL)
with HyperProcess(telemetry=Telemetry.DO_NOT_SEND_USAGE_DATA_TO_TABLEAU) as hyper:
with Connection(hyper.endpoint) as connection:
# Hyper only supports temporary external tables, so we need to create them on every query
connection.execute_command(open("create.sql").read())
for try_num in range(3):
if try_num == 0:
# Flush OS page cache before first run of each query
subprocess.run(['sync'], check=True)
subprocess.run(['sudo', 'tee', '/proc/sys/vm/drop_caches'], input=b'3', check=True, stdout=subprocess.DEVNULL)

start = timeit.default_timer()
with HyperProcess(telemetry=Telemetry.DO_NOT_SEND_USAGE_DATA_TO_TABLEAU) as hyper:
with Connection(hyper.endpoint) as connection:
# Hyper only supports temporary external tables, so we need to create them on every query
connection.execute_command(open("create.sql").read())
start = timeit.default_timer()
try:
connection.execute_list_query(query)
print(round(timeit.default_timer() - start, 3))
Expand Down
8 changes: 4 additions & 4 deletions hyper/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

query = sys.stdin.read()

for _ in range(3):
start = timeit.default_timer()
with HyperProcess(telemetry=Telemetry.DO_NOT_SEND_USAGE_DATA_TO_TABLEAU) as hyper:
with Connection(hyper.endpoint, 'hits.hyper', CreateMode.NONE) as connection:
with HyperProcess(telemetry=Telemetry.DO_NOT_SEND_USAGE_DATA_TO_TABLEAU) as hyper:
with Connection(hyper.endpoint, 'hits.hyper', CreateMode.NONE) as connection:
for _ in range(3):
start = timeit.default_timer()
try:
connection.execute_list_query(query)
print(round(timeit.default_timer() - start, 3))
Expand Down