mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-08-07 11:39:43 +00:00
Fixed fetch benchmarks
This commit is contained in:
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
from test.conf_test import conf, dbmodule
|
from test.conf_test import conf, glob
|
||||||
from benchmarks.setup_db import init_db, end_db
|
from benchmarks.setup_db import init_db, end_db
|
||||||
|
|
||||||
module= dbmodule();
|
module= glob();
|
||||||
dbdrv = importlib.import_module(module["module"])
|
dbdrv = importlib.import_module(module["module"])
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -7,9 +7,8 @@ def str_fetchall(loops, conn):
|
|||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
range_it = range(loops)
|
range_it = range(loops)
|
||||||
t0 = pyperf.perf_counter()
|
t0 = pyperf.perf_counter()
|
||||||
a= (1,)
|
|
||||||
for value in range_it:
|
for value in range_it:
|
||||||
cursor.execute('select col1,col2,col3 from str_test WHERE 1=?', a)
|
cursor.execute('select col1,col2,col3 from str_test')
|
||||||
row= cursor.fetchall()
|
row= cursor.fetchall()
|
||||||
del row
|
del row
|
||||||
del cursor
|
del cursor
|
||||||
@ -19,9 +18,8 @@ def str_fetchloop(loops, conn):
|
|||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
range_it = range(loops)
|
range_it = range(loops)
|
||||||
t0 = pyperf.perf_counter()
|
t0 = pyperf.perf_counter()
|
||||||
a= (1,)
|
|
||||||
for value in range_it:
|
for value in range_it:
|
||||||
cursor.execute('select col1,col2,col3 from str_test WHERE 1=?', a)
|
cursor.execute('select col1,col2,col3 from str_test')
|
||||||
row= cursor.fetchone()
|
row= cursor.fetchone()
|
||||||
while row is not None:
|
while row is not None:
|
||||||
row= cursor.fetchone()
|
row= cursor.fetchone()
|
||||||
@ -32,9 +30,8 @@ def num_fetchall(loops, conn):
|
|||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
range_it = range(loops)
|
range_it = range(loops)
|
||||||
t0 = pyperf.perf_counter()
|
t0 = pyperf.perf_counter()
|
||||||
a= (1,)
|
|
||||||
for value in range_it:
|
for value in range_it:
|
||||||
cursor.execute('select col1,col2,col3,col4,col5 from num_test WHERE 1=?', a)
|
cursor.execute('select col1,col2,col3,col4,col5 from num_test')
|
||||||
row= cursor.fetchall()
|
row= cursor.fetchall()
|
||||||
del row
|
del row
|
||||||
del cursor
|
del cursor
|
||||||
@ -44,9 +41,8 @@ def num_fetchloop(loops, conn):
|
|||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
range_it = range(loops)
|
range_it = range(loops)
|
||||||
t0 = pyperf.perf_counter()
|
t0 = pyperf.perf_counter()
|
||||||
a= (1,)
|
|
||||||
for value in range_it:
|
for value in range_it:
|
||||||
cursor.execute('select col1,col2,col3,col4,col5 from num_test WHERE 1=?', a)
|
cursor.execute('select col1,col2,col3,col4,col5 from num_test')
|
||||||
row= cursor.fetchone()
|
row= cursor.fetchone()
|
||||||
while row is not None:
|
while row is not None:
|
||||||
row= cursor.fetchone()
|
row= cursor.fetchone()
|
||||||
|
@ -6,7 +6,6 @@ import pyperf, os
|
|||||||
from benchmarks.benchmark.do_1 import do1
|
from benchmarks.benchmark.do_1 import do1
|
||||||
from benchmarks.benchmark.fetch import *
|
from benchmarks.benchmark.fetch import *
|
||||||
|
|
||||||
from benchmarks.benchmark.select_str import test_str
|
|
||||||
from benchmarks.benchmark.select_1 import select_1
|
from benchmarks.benchmark.select_1 import select_1
|
||||||
from benchmarks.benchmark.select_param import select_param
|
from benchmarks.benchmark.select_param import select_param
|
||||||
from benchmarks.benchmark.select_10_cols_from_seq_1_to_10000 import \
|
from benchmarks.benchmark.select_10_cols_from_seq_1_to_10000 import \
|
||||||
|
2
site.cfg
2
site.cfg
@ -5,4 +5,4 @@ link_static=on
|
|||||||
# Windows: location of MySQL Connector/C installation
|
# Windows: location of MySQL Connector/C installation
|
||||||
install_dir=c:\Program Files\MariaDB\MariaDB Connector C 64-bit
|
install_dir=c:\Program Files\MariaDB\MariaDB Connector C 64-bit
|
||||||
# Posix: location of mariadb_config executable
|
# Posix: location of mariadb_config executable
|
||||||
mariadb_config=/usr/local/bin/mariadb_config
|
mariadb_config=/home/georg/cc/bin/mariadb_config
|
||||||
|
Reference in New Issue
Block a user