Skip to content

Commit

Permalink
make min/max/avg useful
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Nov 13, 2024
1 parent 90b5b8f commit 1864a1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
luceeVersion: [ 5.4/snapshot/light, 6.0/snapshot/light, 6.1/snapshot/light, 6.2.0.159/snapshot/light ]
luceeVersion: [ 5.4/snapshot/light, 6.0/snapshot/light, 6.1/snapshot/light, 6.2/snapshot/light ]
javaVersion: [ 11, 21 ]
exclude:
- luceeVersion: 5.4/snapshot/light
Expand Down
19 changes: 10 additions & 9 deletions custom/benchmark/index.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
_memBefore = reportMem( "", {}, "before", "HEAP" );
errorCount = 0;
units = "micro";
sleep( 2000 ); // initial time to settle
Expand All @@ -40,14 +41,14 @@
sleep( 2000 ); // time to settle
systemOutput( "Running #type# [#numberFormat( runs )#] times, inspect: [#inspect#]", true );
s = getTickCount();
s = getTickCount(units);
ArrayEach( arr, function( item, idx, _arr ){
var start = getTickCount();
var start = getTickCount(units);
_internalRequest(
template: template
);
arguments._arr[ arguments.idx ] = getTickCount() - start;
arguments._arr[ arguments.idx ] = getTickCount(units) - start;
}, true );
} catch ( e ){
systemOutput( e, true );
Expand All @@ -57,16 +58,16 @@
errorCount++;
}
time = getTickCount()-s;
time = getTickCount(units)-s;
_logger( "Running #type# [#numberFormat( runs )#] times, inspect: [#inspect#] took #numberFormat( time )# ms, or #numberFormat(runs/(time/1000))# per second" );
_logger( "Running #type# [#numberFormat( runs )#] times, inspect: [#inspect#] took #numberFormat( time/1000 )# ms, or #numberFormat(runs/(time/1000/1000))# per second" );
ArrayAppend( results.data, {
time: time,
time: time/1000,
inspect: inspect,
type: type,
_min: int( arrayMin( arr ) ),
_max: int( arrayMax( arr ) ),
_avg: int( arrayAvg( arr ) ),
_min: decimalFormat( arrayMin( arr )/ 1000 ),
_max: decimalFormat( arrayMax( arr )/ 1000 ),
_avg: decimalFormat( arrayAvg( arr )/ 1000 ),
error: runError
});
}
Expand Down

0 comments on commit 1864a1c

Please sign in to comment.