Array vs hex vs number

Benchmark created on


Setup

function assign(x){
	var obj = x
}
const N = 1000

Test runner

Ready to run.

Testing in
TestOps/sec
array
for(var i=0;i<N;i++){
	assign([1, 2, 3])
}
ready
hex
for(var i=0;i<N;i++){
	assign(0x999)
}
ready
number
for(var i=0;i<N;i++){
	assign(314)
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.