mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-07-28 06:40:03 +00:00

benchmark precision improved running on one thread only with at least 1000 warmup operations
19 lines
397 B
Python
19 lines
397 B
Python
#!/usr/bin/env python3 -O
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import pyperf
|
|
|
|
|
|
def select_1(loops, conn, paramstyle):
|
|
cursor = conn.cursor()
|
|
range_it = range(loops)
|
|
t0 = pyperf.perf_counter()
|
|
for value in range_it:
|
|
cursor = conn.cursor()
|
|
cursor.execute("select 1")
|
|
rows = cursor.fetchall()
|
|
del rows
|
|
cursor.close()
|
|
|
|
return pyperf.perf_counter() - t0
|