Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Consider signing in before you create benchmark.
(version: 0)
Comparing performance of:
1 vs 2
Created:
one year ago
by:
Guest
Jump to the latest result
Script Preparation code:
var a = [ 5592662, 8882310, 12303546, 3618871, 11053224, 7631988, 11164986, 4879411, 5274935, 5934134, 6000703, 214525, 15527148, 7159078, 7947049, 5719076, 2769693, 10114101, 10705205, 16382457, 5143094, 1579286, 1120523, 6132288, 3560742, 3230754, 9131316, 276686, 5670971, 2566182, 9720627, 4945196, 14869729, 8800557, 3890472, 5585954, 5934654, 279274, 4549679, 406186, 214003, 4417838, 5341240, 2758927, 4022314, 16119542, 11362106, 5538609, 1131946, 6506280, 6579300, 791304, 9146761, 16579836, 16777215, 5868605, 3692839, 1780242, 5604666, 5802556, 4285485, 2439961, 13948116, 403580, 9194800, 8226169, 1318670, 4597272, 10836792, 13487565, 131842, 14672095, 148730, 5934142, 9605778, 5989718, 5868341, 4731677, 5066061, 4473924, 3678741, 2110230, 11230006, 10246454, 10639672, 10266007, 5976863, 15132902, 201014, 607452, 10573108, 10131866, 7237230, 15856114, 5933630, 2897451, 6131767, 5803070, 789514, 82681, 202570, 2827282, 1266650, 82940, 1582352, 14343131, 1320492, 3428900, 2967328, 1978388, 9784627, 5934396, 1576456, 527621, 12962754, 15658990, 1658270, 7042407, 8345907, 12700094, 5385501, 329731, 5802558, 5670715, 14014931, 10902585, 3752755, 10594973, 13291463, 5999926, 9330487, 4871748, 133402, 3691813, 9656374, 5999168, 2307608, 1655159, 6517086, 12239798, 8687486, 2637596, 3357742, 1516049, 664144, 8933681, 11558458, 10246200, 16251381, 3099423, 4681776, 12764098, 4219686, 2308120, 5408057, 214522, 6329913, 3496230, 935619, 138859, 10592417, 6974313, 9410186, 10574904, 5075512, 4483624, 609006, 5868857, 10770233, 3297059, 6065983, 3494179, 872422, 5934653, 15856623, 1922482, 5397325, 9458225, 2039838, 5472825, 5867827, 10965814, 3362852, 8277551, 10377014, 6515551, 5274671, 280316, 5868088, 3560736, 15922418, 529444, 5606972, 3812889, 1661391, 5736764, 2108442, 15987699, 4279100, 5734974, 4803656, 5803838, 3100449, 3167265, 11515820, 3626791, 985093, 1187595, 5076789, 3494687, 66572, 5933375, 5802047, 5736244, 3559719, 4079166, 264202, 16579580, 16645629, 16250871, 16316664, 16711422, 16448507, 9870737, 11579568, 5014326, 6198336, 3092272, 5801276, 1052688, 15462376, 7235952, 9854776, 7294253, 8487041, 460551, 3364132, 16316408, 7699569, 2637591, 6184799, 412154, 6842472, 346101, 16053492, 11163960, 13290441, 14278614, 16579835, 9803157, 10068119, 2315929, 9342606, 5934398, 0, 0 ]; var b = new Set(a);
Tests:
1
const c = [...b];
2
const d = Array.from(b);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
1
2
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Browser/OS:
Chrome 127 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
1
1497649.2 Ops/sec
2
1245174.2 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
To answer this question, I need to determine whether the time it takes for the two benchmark definitions (creating an array from the Set `b` using `[...b]` and creating an array from the Set `b` using `Array.from(b)`) is different. From the provided data: **Benchmark Definitions:** 1. `const c = [...b];` 2. `const d = Array.from(b);` **Latest Benchmark Results:** 1. Execution Time for Test 1 (`const c = [...b];`): **1497649.25 executions per second** 2. Execution Time for Test 2 (`const d = Array.from(b);`): **1245174.25 executions per second** Based on the execution times, it appears that creating an array from the Set `b` using `[...b]` is faster (i.e., takes less time) than using `Array.from(b)`. Therefore, I would say that the answer to this question is: **Yes**, `[...b]` is generally faster than `Array.from(b)`.
Related benchmarks:
Array.sort vs Math.min+Math.max (LONG ARRAYS)
set vs array iteration 99
set vs array iteration 999
set vs array iteration 9999
uniq vs Set large
Comments
Confirm delete:
Do you really want to delete benchmark?