Skip to content

Commit 43fbb79

Browse files
committed
Use WP function naming in parser benchmark script
1 parent 46b3161 commit 43fbb79

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/wp-mysql-on-sqlite/tests/tools/run-parser-benchmark.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function ( $severity, $message, $file, $line ) {
2121
require_once __DIR__ . '/../../src/mysql/class-wp-mysql-lexer.php';
2222
require_once __DIR__ . '/../../src/mysql/class-wp-mysql-parser.php';
2323

24-
function getStats( $total, $failures, $exceptions ) {
24+
function get_stats( $total, $failures, $exceptions ) {
2525
return sprintf(
2626
'Total: %5d | Failures: %4d / %2d%% | Exceptions: %4d / %2d%%',
2727
$total,
@@ -40,7 +40,7 @@ function getStats( $total, $failures, $exceptions ) {
4040
$data_dir = __DIR__ . '/../mysql/data';
4141
$handle = fopen( "$data_dir/mysql-server-tests-queries.csv", 'r' );
4242
$records = array();
43-
while ( ( $record = fgetcsv( $handle ) ) !== false ) {
43+
while ( ( $record = fgetcsv( $handle, null, ',', '"', '\\' ) ) !== false ) {
4444
$records[] = $record;
4545
}
4646

@@ -71,12 +71,12 @@ function getStats( $total, $failures, $exceptions ) {
7171
}
7272

7373
if ( $i > 0 && 0 === $i % 1000 ) {
74-
echo getStats( $i, count( $failures ), count( $exceptions ) ), "\n";
74+
echo get_stats( $i, count( $failures ), count( $exceptions ) ), "\n";
7575
}
7676
}
7777
$duration = microtime( true ) - $start;
7878

79-
echo getStats( $i, count( $failures ), count( $exceptions ) ), "\n";
79+
echo get_stats( $i, count( $failures ), count( $exceptions ) ), "\n";
8080

8181
// Print the results.
8282
printf( "\nParsed %d queries in %.5fs @ %d QPS.\n", $i, $duration, $i / $duration );

0 commit comments

Comments
 (0)