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
Make array with option values from a select. Compare jQuery Each vs jQuery Map
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<select name="" id="test">
<option value="1">
text 1
</option>
<option value="2">
text 2
</option>
<option value="3">
text 3
</option>
<option value="4">
text 4
</option>
<option value="5">
text 5
</option>
<option value="6">
text 6
</option>
<option value="7">
text 7
</option>
<option value="8">
text 8
</option>
<option value="9">
text 9
</option>
<option value="10">
text 10
</option>
<option value="11">
text 11
</option>
<option value="12">
text 12
</option>
<option value="13">
text 13
</option>
<option value="14">
text 14
</option>
<option value="15">
text 15
</option>
<option value="16">
text 16
</option>
<option value="17">
text 17
</option>
<option value="18">
text 18
</option>
<option value="19">
text 19
</option>
<option value="20">
text 20
</option>
<option value="21">
text 21
</option>
<option value="22">
text 22
</option>
<option value="23">
text 23
</option>
<option value="24">
text 24
</option>
<option value="25">
text 25
</option>
<option value="26">
text 26
</option>
<option value="27">
text 27
</option>
<option value="28">
text 28
</option>
<option value="29">
text 29
</option>
<option value="30">
text 30
</option>
<option value="31">
text 31
</option>
<option value="32">
text 32
</option>
<option value="33">
text 33
</option>
<option value="34">
text 34
</option>
<option value="35">
text 35
</option>
<option value="36">
text 36
</option>
<option value="37">
text 37
</option>
<option value="38">
text 38
</option>
<option value="39">
text 39
</option>
<option value="40">
text 40
</option>
<option value="41">
text 41
</option>
<option value="42">
text 42
</option>
<option value="43">
text 43
</option>
<option value="44">
text 44
</option>
<option value="45">
text 45
</option>
<option value="46">
text 46
</option>
<option value="47">
text 47
</option>
<option value="48">
text 48
</option>
<option value="49">
text 49
</option>
<option value="50">
text 50
</option>
<option value="51">
text 51
</option>
<option value="52">
text 52
</option>
<option value="53">
text 53
</option>
<option value="54">
text 54
</option>
<option value="55">
text 55
</option>
<option value="56">
text 56
</option>
<option value="57">
text 57
</option>
<option value="58">
text 58
</option>
<option value="59">
text 59
</option>
<option value="60">
text 60
</option>
<option value="61">
text 61
</option>
<option value="62">
text 62
</option>
<option value="63">
text 63
</option>
<option value="64">
text 64
</option>
<option value="65">
text 65
</option>
<option value="66">
text 66
</option>
<option value="67">
text 67
</option>
<option value="68">
text 68
</option>
<option value="69">
text 69
</option>
<option value="70">
text 70
</option>
<option value="71">
text 71
</option>
<option value="72">
text 72
</option>
<option value="73">
text 73
</option>
<option value="74">
text 74
</option>
<option value="75">
text 75
</option>
<option value="76">
text 76
</option>
<option value="77">
text 77
</option>
<option value="78">
text 78
</option>
<option value="79">
text 79
</option>
<option value="80">
text 80
</option>
<option value="81">
text 81
</option>
<option value="82">
text 82
</option>
<option value="83">
text 83
</option>
<option value="84">
text 84
</option>
<option value="85">
text 85
</option>
<option value="86">
text 86
</option>
<option value="87">
text 87
</option>
<option value="88">
text 88
</option>
<option value="89">
text 89
</option>
<option value="90">
text 90
</option>
<option value="91">
text 91
</option>
<option value="92">
text 92
</option>
<option value="93">
text 93
</option>
<option value="94">
text 94
</option>
<option value="95">
text 95
</option>
<option value="96">
text 96
</option>
<option value="97">
text 97
</option>
<option value="98">
text 98
</option>
<option value="99">
text 99
</option>
<option value="100">
text 100
</option>
</select>
var $options = $('option', '#test');
var options = [];
Ready to run.
Test | Ops/sec | |
---|---|---|
Using Each |
| ready |
Using Map |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.