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
<script src="http://cdn.leafletjs.com/leaflet-0.4.5/leaflet.js"></script>
var latLng1 = [-37.7772, 175.2756];
var latLng2 = {lat: -37.7772, lng: 175.2756};
var meters = [100, 100];
var moveCoordinatesByMetres = function(latLng, m) {
var pi = Math.PI;
//Earth’s radius, sphere
var R = 6378137;
// latLng to transform
var lat = latLng[0] || latLng.lat;
var lng = latLng[1] || latLng.lng;
//Coordinate offsets in radians
var dLat = m[0] / R;
var dLng = m[1] / ( R * Math.cos(pi * lat / 180) );
//OffsetPosition, decimal degrees
lat = lat + ( dLat * 180 / pi );
lng = lng + ( dLng * 180 / pi );
return [lat, lng];
}
Ready to run.
Test | Ops/sec | |
---|---|---|
LatLng1 |
| ready |
LatLng2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.