Skip to content

Commit

Permalink
[misc] bench label correction
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Feb 3, 2023
1 parent 7b9001f commit 5500df2
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion benchmarks/benchs/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for (let i = 1; i < 10; i++) {
sqlInsert = 'INSERT INTO perfTestText(' + sqlCol + ') VALUES (?' + sqlParam + ')';
sqlTable += ', PRIMARY KEY (id))';

module.exports.title = 'insert 10 parameters of 100 characters';
module.exports.title = 'insert 10 VARCHAR(100)';
module.exports.displaySql = 'INSERT INTO perfTestText VALUES (?, ?, ?, ?, ?,?, ?, ?, ?, ?)';
module.exports.benchFct = async function (conn, type, deferred) {
const params = [];
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/benchs/insert_batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ function randomString(length) {
sqlInsert = 'INSERT INTO perfTestTextBatch(t0) VALUES (?)';

module.exports.title =
"100 * insert 100 characters using batch method (for mariadb) or loop for other driver (batch doesn't exists)";
"100 * insert CHAR(100) using batch (for mariadb) or loop for other driver (batch doesn't exists)";
module.exports.displaySql = 'INSERT INTO perfTestTextBatch VALUES (?)';
const iterations = 100;
module.exports.benchFct = async function (conn, type, deferred) {
const params = [randomString(100)];
// console.log(connType.desc);
if (type !== 'mariadb') {
//other driver doesn't have bulk method
let ended = 0;
const queries = [];
for (let i = 0; i < iterations; i++) {
const rows = await conn.query(sqlInsert, params);
if (++ended === iterations) {
deferred.resolve(rows);
}
queries.push(conn.query(sqlInsert, params));
}
const res = await Promise.all(queries);
deferred.resolve(res);
return;
} else {
//use batch capability
const totalParams = new Array(iterations);
Expand Down
8 changes: 0 additions & 8 deletions benchmarks/benchs/select_1.js

This file was deleted.

2 changes: 1 addition & 1 deletion benchmarks/benchs/select_1000_rows.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports.title = 'select 1000 rows';
module.exports.title = 'select 1000 rows of CHAR(32)';
module.exports.displaySql = 'select * from 1000 rows (int + string(32))';
module.exports.benchFct = async function (conn, type, deferred) {
const res = await conn.query('select * from 1000rows');
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchs/select_1000_rows_execute.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports.title = 'select 1000 rows - BINARY';
module.exports.title = 'select 1000 rows of CHAR(32) - BINARY';
module.exports.displaySql = 'select * from 1000 rows (int + string(32))';
module.exports.requireExecute = true;
module.exports.benchFct = async function (conn, type, deferred) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion benchmarks/benchs/select_1_int_char.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports.title = 'select 1 int + char';
module.exports.title = 'select 1 int + char(32)';
module.exports.displaySql = "select 1, 'abcdefghijabcdefghijabcdefghijaa'";
module.exports.benchFct = async function (conn, type, deferred) {
const rows = await conn.query("select 1, 'abcdefghijabcdefghijabcdefghijaa'");
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchs/select_1_int_char_pool.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports.title = 'select 1 int + char with pool';
module.exports.title = 'select 1 int + char(32) with pool';
module.exports.displaySql = "select 1, 'abcdefghijabcdefghijabcdefghijaa'";
module.exports.pool = true;
module.exports.benchFct = async function (pool, type, deferred) {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchs/select_1_int_char_random.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports.title = 'select 1 random int + char';
module.exports.title = 'select 1 random int + char(32)';
module.exports.displaySql = "select 1, 'abcdefghijabcdefghijabcdefghijaa'";
module.exports.benchFct = async function (conn, type, deferred) {
const randVal = Math.floor(Math.random() * 1000000);
Expand Down
8 changes: 8 additions & 0 deletions benchmarks/benchs/select_now.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const assert = require('assert');

module.exports.title = 'select now()';
module.exports.displaySql = 'select now()';
module.exports.benchFct = async function (conn, type, deferred) {
const rows = await conn.query('select now()');
deferred.resolve(rows);
};

0 comments on commit 5500df2

Please sign in to comment.