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
mysort = function (arr) {
for (var i = 0 ; i < arr.length ; i++) {
var n = arr[i];
for (var j = i+1 ; j < arr.length ; j++) {
if (arr[j] < n) {
arr[i] = arr[j];
arr[j] = n;
n = arr[i];
j = i + 1;
}
}
}
return arr;
}
function sortBubble(data) {
var tmp;
for (var i = data.length - 1; i > 0; i--) {
for (var j = 0; j < i; j++) {
if (data[j] > data[j+1]) {
tmp = data[j];
data[j] = data[j+1];
data[j+1] = tmp;
}
}
}
return data;
}
var data = [672, 370, 888, 494, 601, 890, 846, 246, 579, 663, 143, 942, 124, 484, 295, 960, 956, 25, 517, 748, 498, 97, 590, 163, 848, 915, 210, 507, 605, 45, 943, 816, 147, 615, 290, 607, 317, 24, 59, 803, 678, 415, 262, 379, 148, 751, 827, 345, 636, 286, 170, 6, 379, 634, 413, 984, 986, 336, 217, 44, 843, 522, 79, 595, 934, 996, 274, 249, 216, 567, 344, 142, 303, 81, 921, 788, 995, 606, 653, 829, 830, 295, 931, 917, 59, 749, 28, 765, 655, 608, 355, 928, 303, 523, 881, 66, 352, 637, 339, 174, 183, 742, 138, 705, 137, 703, 39, 369, 505, 619, 444, 448, 274, 310, 326, 565, 886, 669, 629, 326, 936, 667, 463, 232, 27, 342, 862, 84, 716, 861, 863, 194, 593, 349, 346, 575, 473, 83, 457, 910, 6, 379, 916, 581, 175, 470, 767, 685, 967, 58, 363, 662, 272, 273, 226, 509, 979, 312, 510, 840, 742, 271, 622, 511, 235, 151, 202, 306, 938, 764, 841, 379, 122, 77, 400, 675, 921, 64, 419, 207, 607, 860, 15, 383, 943, 765, 588, 727, 607, 479, 503, 111, 367, 551, 940, 916, 834, 964, 8, 871, 475, 391, 55, 535, 954, 13, 500, 428, 322, 56, 457, 693, 748, 601, 192, 437, 960, 33, 372, 799, 96, 215, 7, 662, 511, 646, 661, 56, 613, 808, 168, 567, 534, 684, 269, 431, 189, 504, 998, 393, 496, 434, 671, 396, 213, 832, 513, 85, 503, 681, 643, 360, 864, 62, 271, 797, 183, 441, 140, 844, 830, 903, 127, 490, 222, 292, 905, 980, 967, 197, 846, 56, 372, 918, 459, 44, 481, 132, 572, 815, 448, 557, 870, 416, 412, 606, 574, 851, 518, 625, 114, 155, 54, 88, 885, 691, 457, 752, 125, 453, 307, 477, 757, 985, 367, 264, 143, 938, 793, 129, 144, 868, 333, 663, 750, 824, 331, 567, 341, 933, 115, 919, 34, 725, 61, 206, 525, 752, 606, 725, 998, 31, 487, 693, 874, 688, 987, 573, 198, 975, 769, 46, 649, 44, 384, 137, 978, 144, 357, 773, 118, 645, 988, 671, 639, 951, 39, 454, 755, 710, 468, 816, 167, 706, 812, 133, 295, 396, 177, 749, 278, 789, 896, 10, 545, 734, 943, 898, 728, 346, 673, 785, 869, 571, 998, 47, 273, 88, 614, 56, 297, 83, 732, 15, 792, 9, 813, 416, 739, 337, 671, 691, 421, 441, 582, 970, 387, 978, 401, 959, 58, 879, 22, 743, 91, 746, 352, 100, 28, 547, 662, 109, 435, 59, 103, 437, 442, 509, 616, 490, 680, 84, 587, 258, 927, 458, 746, 452, 493, 452, 372, 712, 723, 890, 298, 225, 30, 239, 985, 423, 164, 432, 77, 892, 633, 998, 659, 299, 873, 265, 298, 471, 18, 471, 128, 726, 163, 567, 766, 49, 590, 252, 31, 812, 506, 75, 520, 168, 913, 548, 327, 171, 256, 22, 648, 584, 130, 348, 389, 218, 193, 818, 850, 420, 506, 998, 662, 795, 91, 422, 537, 606, 702, 942, 344, 472, 991, 88, 710, 75, 368, 104, 196, 664, 910, 219, 312, 164, 570, 188, 71, 227, 302, 91, 363, 496, 742, 875, 88, 972, 641, 6, 349, 992, 619, 269, 848, 535, 223, 541, 533, 142, 235, 496, 813, 172, 306, 822, 789, 13, 250, 31, 782, 499, 843, 759, 991, 39, 964, 507, 576, 875, 482, 962, 984, 290, 876, 938, 918, 222, 124, 42, 943, 8, 520, 835, 872, 805, 315, 232, 830, 88, 560, 623, 903, 555, 589, 545, 306, 629, 855, 540, 68, 62, 358, 895, 337, 698, 743, 829];
Ready to run.
Test | Ops/sec | |
---|---|---|
native sort |
| ready |
my sort |
| ready |
bubble sort |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.