Browse Source
benchmark: convert var to es6 const
Converted var variable to es6 const to maintain
consistency with other benchmark files. Also clean up
the types array to make the files more succinct.
PR-URL: https://github.com/nodejs/node/pull/12886
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
canary-base
Sebastian Murphy
8 years ago
committed by
Refael Ackermann
No known key found for this signature in database
GPG Key ID: CD704BD80FDDDB64
3 changed files with
51 additions and
57 deletions
benchmark/arrays/var-int.js
benchmark/arrays/zero-float.js
benchmark/arrays/zero-int.js
@ -1,28 +1,26 @@
'use strict' ;
var common = require ( '../common.js' ) ;
const common = require ( '../common.js' ) ;
var types = [
'Array' ,
'Buffer' ,
'Int8Array' ,
'Uint8Array' ,
'Int16Array' ,
'Uint16Array' ,
'Int32Array' ,
'Uint32Array' ,
'Float32Array' ,
'Float64Array'
] ;
var bench = common . createBenchmark ( main , {
type : types ,
const bench = common . createBenchmark ( main , {
type : [
'Array' ,
'Buffer' ,
'Int8Array' ,
'Uint8Array' ,
'Int16Array' ,
'Uint16Array' ,
'Int32Array' ,
'Uint32Array' ,
'Float32Array' ,
'Float64Array'
] ,
n : [ 25 ]
} ) ;
function main ( conf ) {
var type = conf . type ;
var clazz = global [ type ] ;
var n = + conf . n ;
const type = conf . type ;
const clazz = global [ type ] ;
const n = + conf . n ;
bench . start ( ) ;
var arr = new clazz ( n * 1e6 ) ;
@ -1,28 +1,26 @@
'use strict' ;
var common = require ( '../common.js' ) ;
const common = require ( '../common.js' ) ;
var types = [
'Array' ,
'Buffer' ,
'Int8Array' ,
'Uint8Array' ,
'Int16Array' ,
'Uint16Array' ,
'Int32Array' ,
'Uint32Array' ,
'Float32Array' ,
'Float64Array'
] ;
var bench = common . createBenchmark ( main , {
type : types ,
const bench = common . createBenchmark ( main , {
type : [
'Array' ,
'Buffer' ,
'Int8Array' ,
'Uint8Array' ,
'Int16Array' ,
'Uint16Array' ,
'Int32Array' ,
'Uint32Array' ,
'Float32Array' ,
'Float64Array'
] ,
n : [ 25 ]
} ) ;
function main ( conf ) {
var type = conf . type ;
var clazz = global [ type ] ;
var n = + conf . n ;
const type = conf . type ;
const clazz = global [ type ] ;
const n = + conf . n ;
bench . start ( ) ;
var arr = new clazz ( n * 1e6 ) ;
@ -1,28 +1,26 @@
'use strict' ;
var common = require ( '../common.js' ) ;
const common = require ( '../common.js' ) ;
var types = [
'Array' ,
'Buffer' ,
'Int8Array' ,
'Uint8Array' ,
'Int16Array' ,
'Uint16Array' ,
'Int32Array' ,
'Uint32Array' ,
'Float32Array' ,
'Float64Array'
] ;
var bench = common . createBenchmark ( main , {
type : types ,
const bench = common . createBenchmark ( main , {
type : [
'Array' ,
'Buffer' ,
'Int8Array' ,
'Uint8Array' ,
'Int16Array' ,
'Uint16Array' ,
'Int32Array' ,
'Uint32Array' ,
'Float32Array' ,
'Float64Array'
] ,
n : [ 25 ]
} ) ;
function main ( conf ) {
var type = conf . type ;
var clazz = global [ type ] ;
var n = + conf . n ;
const type = conf . type ;
const clazz = global [ type ] ;
const n = + conf . n ;
bench . start ( ) ;
var arr = new clazz ( n * 1e6 ) ;