BigInt vs Integer (v2)

Revision 2 of this benchmark created on


Setup

function ParseIntHash(x, y) {
	x = parseInt(x) - (parseInt(x) % 10);
	y = parseInt(y) - (parseInt(y) % 10);
	return x + "|" + y;
}
function TruncIntHash(x, y) {
	x = Math.trunc(x) - (Math.trunc(x) % 10);
	y = Math.trunc(y) - (Math.trunc(y) % 10);
	return x + "|" + y;
}
var X = Math.random() * 1000 - 500;
var Y = Math.random() * 1000 - 500;
var RESULT = 0;

Teardown

delete RESULT;

Test runner

Ready to run.

Testing in
TestOps/sec
Parse Integer
RESULT = ParseIntHash(X, Y);
ready
Trunc Integer
RESULT = TruncIntHash(X, Y);
ready

Revisions

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