var n = 10;
var arr = new Array(n);
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 10;
var arr = [];
for (var i = 0; i < n; i++) {
arr.push(i);
}
var n = 10;
var arr = [];
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 10;
var arr = [];
arr.length = n;
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 1000;
var arr = new Array(n);
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 1000;
var arr = [];
for (var i = 0; i < n; i++) {
arr.push(i);
}
var n = 1000;
var arr = [];
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 1000;
var arr = [];
arr.length = n;
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 100000;
var arr = new Array(n);
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 100000;
var arr = [];
for (var i = 0; i < n; i++) {
arr.push(i);
}
var n = 100000;
var arr = [];
for (var i = 0; i < n; i++) {
arr[i] = i;
}
var n = 100000;
var arr = [];
arr.length = n;
for (var i = 0; i < n; i++) {
arr[i] = i;
}
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
Array constructor - 10 items | |
Array literal - 10 items | |
Array literal (assign by index) - 10 items | |
Array literal (explicit length) - 10 items | |
Array constructor - 1000 items | |
Array literal - 1000 items | |
Array literal (assign by index) - 1000 items | |
Array literal (explicit length) - 1000 items | |
Array constructor - 100000 items | |
Array literal - 100000 items | |
Array literal (assign by index) - 100000 items | |
Array literal (explicit length) - 100000 items |
Test name | Executions per second |
---|---|
Array constructor - 10 items | 5364987.5 Ops/sec |
Array literal - 10 items | 28669618.0 Ops/sec |
Array literal (assign by index) - 10 items | 28688986.0 Ops/sec |
Array literal (explicit length) - 10 items | 7094729.5 Ops/sec |
Array constructor - 1000 items | 869656.9 Ops/sec |
Array literal - 1000 items | 254121.5 Ops/sec |
Array literal (assign by index) - 1000 items | 280799.5 Ops/sec |
Array literal (explicit length) - 1000 items | 848051.4 Ops/sec |
Array constructor - 100000 items | 5090.6 Ops/sec |
Array literal - 100000 items | 1591.1 Ops/sec |
Array literal (assign by index) - 100000 items | 1679.7 Ops/sec |
Array literal (explicit length) - 100000 items | 5251.0 Ops/sec |
It looks like we have a JSON object here, but it's not in the typical format. Let me try to parse it and help you with your question.
The provided data appears to be an array of test results for various JavaScript-related tests. Each object in the array represents a single test result, with properties such as RawUAString
, Browser
, DevicePlatform
, OperatingSystem
, ExecutionsPerSecond
, and TestName
.
If you could provide more context or clarify what specific question or problem you'd like help with, I'll do my best to assist you!