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 arrayA = [-9744,-4812,4876,-7023,-4436,-13027,-8876,581,4743,2387,4587,-1372,-2602,-7235,-9075,-990,-6706,-13239,-5040,-4916,4546,-12195,-6042,-4241,-9545,4981,-9004,576,242,-7926,-3607,-3338,-3952,-9307,1020,-6577,-1105,3313,-3494,-12292,2505,-11344,-8147,-6885,-10456,3787,-1203,-4246,-8296,-12990,466,-1661,-6920,-9872,-371,3777,-9701,-1821,-4423,-9598,3092,1201,3081,-6812,3670,-9966,-11215,-5867,-2807,-9734,-3651,-2513,3183,-6013,-5585,-5385,-3778,-3727,-7254,-1438,1062,3112,-5671,4461,-9424,-8037,-9101,-4321,-1034,-13208,-13305,1369,-1086,-559,-12531,3676,-10790,-4483,-10019,-13364,658,-11646,3883,-12984,-712,-4667,-12088,-7174,1018,-4574,2255,-2470,-4785,3267,-1014,2407,-7317,-11996,-12802,1963,-5809,3150,-9001,-1497,-6223,-7037,-7277,-1732,2409,-3410,-479,-12144,981,-2537,4765,-8562,-9055,-5413,3000,-6869,-1795,-873,-8827,-4403,-10054,-1085,-934,-9338,-7856,-1069,-11912,-1869,1134,-1308,-10298,-627,-7675,-9614,3249,-9214,694,-11927,-11668,2284,-5472,-12841,-9256,-10471,-1798,4762,4180,4482,-5140,1163,-12553,-10303,-471,-5313,-8673,-7166,-9772,-745,-13442,-7771,4776,-7569,-6911,-9377,-11644,-8144,4234,-6036,-10493,2825,-3791,-7053,2709,-3579,-9280,-7038,488,-10657,-11331,1753,1737,-7763,-3260,4268,4883,-4839,-358,-11883,-10818,-1784,-12175,-3420,1789,-9697,1968,-4674,-10716,4135,580,1397,2203,-2038,-6721,4767,-421,-3832,-7424,-2791,-3205,-12565,4738,-5173,-12845,1739,-12981,-2884,-445,-5368,-8402,-3884,-2922,-276,-4328,-38,-11959,-2135,-1540,-10270,-6260,-719,-4615,1371,3611,-90,-10583,-6977,-5861,-3763,-4503,2739,622,-12083,-8089,-5283,-8924,-5150,101,-1279,-9518,4069,2868,-4406,-8594,-11676,-1095,4944,-4868,1291,-7226,-5488,-2350,3162,-12087,-6780,-495,-9301,-5677,-78,1095,-8306,-1963,-9315,-8902,2686,-9089,124,-3321,-3523,-275,-9901,4970,-2645,4403,-1688,-5987,4510,2167,2428,2757,-11285,-10664,-10699,-2480,-9790,3132,-3734,-8032,-1524,-11957,179,-8138,-1789,-24,-11723,1515,-11304,-5742,-2044,-7674,-3767,-1812,2109,-12753,3030,-3543,-1598,-5401,833,-799,-3110,-2528,-9862,-13194,-9900,-5371,-7851,1600,-12050,-7281,-5829,-235,-1569,-10900,-12344,-916,-6329,-1868,680,-6428,2161,-111,-5910,2812,1006,-3407,-5336,3875,-10722,-6507,-942,-7411,2519,-4388,798,-12090,-7996,3999,-8743,-1146,-7774,-12303,-7879,-10119,-8875,-12674,-12633,-9800,-3038,1676,-2153,-7713,-7829,343,-4877,-11142,-2469,-972,938,-8513,-815,-9057,-10104,-5361,-6682,-6906,-6133,4310,-9143,1424,2561,116,-6565,-10357,-3878,-7278,-1448,4853,98,528,-4209,1756,-3470,-3858,-12971,-8385,-3301,-11551,-11011,-3448,-452,628,4063,3928,-7229,3375,821,-1224,-7744,-6944,-7703,-5281,-9955,-5917,-9951,3354,-616,-6306,4465,-11670,-10785,-1983,-1911,-10718,-4891,-2822,-10582,-5012,-4635,1183,-273,-13429,4730,-1629,-5731,-12710,-10822,-7900,-1410,-12000,-3014,-10290,-11749,-5372,838,-11081,-10143,-1327,-12547,-4526,-7970,-3235,1811,4319,-6276,835,-7140,-12325,-13415,2520,-6936,-1981,3738,-3957,-4541,-13343,4214];
var arrayB = [659,-5361,-8488,-4521,-6106,1171,3457,-12319,-9016,4841,-9580,-12625,1017,-10024,-7915,-5870,-6729,4848,-12716,-9451,-676,-3436,-420,-2295,-2081,-8214,-2320,-7108,-7504,-1544,-3586,-3697,-2280,-5494,-2859,-4007,-5243,2516,-11942,3154,-8167,-7397,-9317,-2052,-6431,-474,-7655,-12150,-12292,-10439,-7855,-12328,-12113,3912,-10197,3329,2738,2075,-11829,-5135,2181,2886,1136,-3283,-12858,-5784,-1262,-5278,-8475,-10466,-2257,-6869,-12860,-8684,-13283,-11856,-7247,-10868,-3049,-6314,-3871,-1991,-11627,1963,2771,-8854,-9861,4706,191,-6295,-2911,3188,1278,471,-11797,-13135,-3950,28,-4961,-2633,3135,3763,-3300,2068,-8323,749,3225,-10939,-214,-12298,-890,-13362,285,1300,3054,3416,-5963,-13306,2012,-12318,-8772,-9603,-12489,-1197,2544,-8763,3119,-12790,1233,-4988,-110,-7518,-12706,-5387,-9281,-7899,3353,-2243,-6976,-6583,-1549,-12660,-12194,4564,-10943,-3740,1402,-9717,2266,-415,1753,-11821,-917,4513,777,-6477,640,-10147,2931,-9176,3257,4611,-12681,-3118,-10578,1968,-10823,-9791,-6798,-8165,-2076,-10031,-4974,-4047,-10955,-10355,-6566,-7671,-13472,-6563,2346,-12230,-9679,-11674,-2440,-12268,-10088,4353,-11684,1319,-8470,3453,423,-2036,-956,-736,-12667,-7281,-1978,-10046,-11946,-7005,-2479,-11457,-177,878,-233,1019,-5131,-3284,-1560,-12959,-4036,2964,4232,-10964,-4024,-5164,-9391,-2487,-97,-5262,120,4654,-4573,3062,2774,-8319,3964,-4986,4692,-5016,-5901,-5148,-5341,-11959,-3338,3027,3848,-10180,-10724,-10015,-9804,-2610,-12942,-11005,-7912,-5220,-431,-9235,3694,-2670,-6229,-11020,-8472,4740,-8617,1151,-8565,-3624,-3793,-12266,-2817,10,-10296,-2744,-5877,-4226,-11148,4908,4734,-5004,-9481,-201,2406,-7276,-11180,-1494,4092,-4701,-5589,-8110,-2675,-8942,2901,-5063,4962,-12603,-8238,3701,2617,-5337,-9631,-3023,-12474,3641,-10291,1367,-2071,834,-4837,-12226,-1074,-996,4278,4798,-8396,-23,-411,1149,-7233,-2006,-6813,-7288,-12177,-5056,-7259,2956,-4422,-13358,-8525,-8948,-12207,-9513,-11891,-3526,-7595,-7357,1044,1865,-5814,3001,-7445,-12479,-7625,3902,-8782,-12072,-13477,-11996,-2318,-2216,-1383,-13299,2647,4717,-500,4193,-678,-8886,-7257,2971,-2822,-7782,500,-5865,-81,3060,-8427,-8370,-11103,2103,-4147,-8733,-10339,-7354,-6459,3146,-10790,538,-8669,335,-17,-12971,-8479,1176,-12591,803,4284,177,-9705,-4560,1774,-592,-9936,-5134,-13326,-8374,-8850,-12665,-9433,-1721,-2431,-9059,-2399,-7630,-2760,-8029,-9201,-3204,-10159,3796,1660,-192,-7048,-6313,-3855,-4984,-12406,-1596,-9965,-8230,-7371,4519,-3929,-5930,-2045,-10212,-8564,-11884,-274,1384,-5140,-7072,-2966,4178,-13261,1200,-597,4735,-6425,817,-8896,-8547,2004,-2714,-12289,248,-8626,2729,183,4159,-11719,1967,2310,-2389,-5673,-1225,-11341,3830,-1695,-8123,3593,-8503,-6696,-9493,-8749,-10850,-8827,4856,-12356,-8019,-1589,4035,-5019,2090,-4736,-13162,-11760,-1166,-5511,-6396,-5352,2390,-12256,3276,1269,-3042,-9843,2550,-11444,-5764,-7437,-5109,-11368,-866,-9652,2600,3449,-7111,492,-9799,-13065,-3098,-3648,-9299,-12724,-7851,-4819,2538];
function abs1(curr, prev) {
return (curr - prev)/Math.abs(prev)*(curr < 0 ? -1 : 1);
}
function abs2(curr, prev) {
var x = (curr - prev)/Math.abs(prev);
return curr < 0 ? -x : x;
}
function sqr1(curr, prev) {
return Math.sqrt((curr - prev)**2 / prev**2)
}
Ready to run.
Test | Ops/sec | |
---|---|---|
Absolute value calculation 1 |
| ready |
Absolute value calculation 2 |
| ready |
Square root calculation 1 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.