Skip to content

Commit baed14b

Browse files
committed
refactor: use uniform array in benchmarks
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: passed - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 1d1750c commit baed14b

File tree

1 file changed

+3
-10
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/bradford/median/benchmark

1 file changed

+3
-10
lines changed

lib/node_modules/@stdlib/stats/base/dists/bradford/median/benchmark/benchmark.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var Float64Array = require( '@stdlib/array/float64' );
25-
var uniform = require( '@stdlib/random/base/uniform' );
26-
var EPS = require( '@stdlib/constants/float64/eps' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
2725
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2826
var pkg = require( './../package.json' ).name;
2927
var median = require( './../lib' );
@@ -32,20 +30,15 @@ var median = require( './../lib' );
3230
// MAIN //
3331

3432
bench( pkg, function benchmark( b ) {
35-
var len;
3633
var c;
3734
var y;
3835
var i;
3936

40-
len = 100;
41-
c = new Float64Array( len );
42-
for ( i = 0; i < len; i++ ) {
43-
c[ i ] = uniform( EPS, 10.0 );
44-
}
37+
c = uniform( 100, 0.1, 10.0 );
4538

4639
b.tic();
4740
for ( i = 0; i < b.iterations; i++ ) {
48-
y = median( c[ i % len ] );
41+
y = median( c[ i % c.length ] );
4942
if ( isnan( y ) ) {
5043
b.fail( 'should not return NaN' );
5144
}

0 commit comments

Comments
 (0)