jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
var geodistance1 = function(A, B) {
var A = A || [55.949444, -3.160278],
B = B || [51.507222, -0.1275];
return 3956 * 2 * Math.asin(Math.sqrt(Math.pow(Math.sin((A[0] - Math.abs(B[0])) * Math.PI / 180 / 2), 2) + Math.cos(A[0] * Math.PI / 180) * Math.cos(Math.abs(B[0]) * Math.PI / 180) * Math.pow(Math.sin((A[1] - B[1]) * Math.PI / 180 / 2), 2)));
};
var geodistance2 = function(A, B) {
var A = A || [55.949444, -3.160278],
B = B || [51.507222, -0.1275],
ASIN = Math.asin,
SQRT = Math.sqrt,
POW = Math.pow,
SIN = Math.sin,
ABS = Math.abs,
PI = Math.PI,
COS = Math.cos;
return 3956 * 2 * ASIN(SQRT(POW(SIN((A[0] - ABS(B[0])) * PI / 180 / 2), 2) + COS(A[0] * PI / 180) * COS(ABS(B[0]) * PI / 180) * POW(SIN((A[1] - B[1]) * PI / 180 / 2), 2)));
};
var geodistance3 = function(A, B) {
var A = A || [55.949444, -3.160278],
B = B || [51.507222, -0.1275],
M = Math,
ASIN = M.asin,
SQRT = M.sqrt,
POW = M.pow,
SIN = M.sin,
ABS = M.abs,
PI = M.PI,
COS = M.cos;
return 3956 * 2 * ASIN(SQRT(POW(SIN((A[0] - ABS(B[0])) * PI / 180 / 2), 2) + COS(A[0] * PI / 180) * COS(ABS(B[0]) * PI / 180) * POW(SIN((A[1] - B[1]) * PI / 180 / 2), 2)));
};
Ready to run.
Test | Ops/sec | |
---|---|---|
vars not cached |
| ready |
vars cached |
| ready |
math cached |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.