rm new
This commit is contained in:
@@ -34,8 +34,8 @@ function itemCheck(node) {
|
|||||||
|
|
||||||
function bottomUpTree(depth) {
|
function bottomUpTree(depth) {
|
||||||
return depth > 0
|
return depth > 0
|
||||||
? new TreeNode(bottomUpTree(depth - 1), bottomUpTree(depth - 1))
|
? TreeNode(bottomUpTree(depth - 1), bottomUpTree(depth - 1))
|
||||||
: new TreeNode(null, null);
|
: TreeNode(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
mainThread()
|
mainThread()
|
||||||
|
|||||||
@@ -151,13 +151,12 @@ function benchObjectCreation() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function Point(x, y) {
|
function Point(x, y) {
|
||||||
this.x = x;
|
return {x,y}
|
||||||
this.y = y;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var defructorTime = measureTime(function() {
|
var defructorTime = measureTime(function() {
|
||||||
for (var i = 0; i < iterations.medium; i++) {
|
for (var i = 0; i < iterations.medium; i++) {
|
||||||
var p = new Point(i, i * 2);
|
var p = Point(i, i * 2);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,11 @@ var SOLAR_MASS = 4 * pi * pi;
|
|||||||
var DAYS_PER_YEAR = 365.24;
|
var DAYS_PER_YEAR = 365.24;
|
||||||
|
|
||||||
function Body(x, y, z, vx, vy, vz, mass) {
|
function Body(x, y, z, vx, vy, vz, mass) {
|
||||||
this.x = x;
|
return {x, y, z, vx, vy, vz, mass};
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
this.vx = vx;
|
|
||||||
this.vy = vy;
|
|
||||||
this.vz = vz;
|
|
||||||
this.mass = mass;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Jupiter() {
|
function Jupiter() {
|
||||||
return new Body(
|
return Body(
|
||||||
4.84143144246472090e+00,
|
4.84143144246472090e+00,
|
||||||
-1.16032004402742839e+00,
|
-1.16032004402742839e+00,
|
||||||
-1.03622044471123109e-01,
|
-1.03622044471123109e-01,
|
||||||
@@ -25,7 +19,7 @@ function Jupiter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Saturn() {
|
function Saturn() {
|
||||||
return new Body(
|
return Body(
|
||||||
8.34336671824457987e+00,
|
8.34336671824457987e+00,
|
||||||
4.12479856412430479e+00,
|
4.12479856412430479e+00,
|
||||||
-4.03523417114321381e-01,
|
-4.03523417114321381e-01,
|
||||||
@@ -37,7 +31,7 @@ function Saturn() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Uranus() {
|
function Uranus() {
|
||||||
return new Body(
|
return Body(
|
||||||
1.28943695621391310e+01,
|
1.28943695621391310e+01,
|
||||||
-1.51111514016986312e+01,
|
-1.51111514016986312e+01,
|
||||||
-2.23307578892655734e-01,
|
-2.23307578892655734e-01,
|
||||||
@@ -49,7 +43,7 @@ function Uranus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Neptune() {
|
function Neptune() {
|
||||||
return new Body(
|
return Body(
|
||||||
1.53796971148509165e+01,
|
1.53796971148509165e+01,
|
||||||
-2.59193146099879641e+01,
|
-2.59193146099879641e+01,
|
||||||
1.79258772950371181e-01,
|
1.79258772950371181e-01,
|
||||||
@@ -61,7 +55,7 @@ function Neptune() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Sun() {
|
function Sun() {
|
||||||
return new Body(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SOLAR_MASS);
|
return Body(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, SOLAR_MASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
var bodies = Array(Sun(), Jupiter(), Saturn(), Uranus(), Neptune());
|
var bodies = Array(Sun(), Jupiter(), Saturn(), Uranus(), Neptune());
|
||||||
|
|||||||
@@ -66,12 +66,6 @@ def benchmarks = [
|
|||||||
data: [ array(1000, i => i *0.5) ],
|
data: [ array(1000, i => i *0.5) ],
|
||||||
iterations: 1000
|
iterations: 1000
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "Large Binary Blob (256KB)",
|
|
||||||
// A 256KB ArrayBuffer
|
|
||||||
data: [ new Uint8Array(256 * 1024).buffer ],
|
|
||||||
iterations: 200
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Print a header
|
// Print a header
|
||||||
|
|||||||
Reference in New Issue
Block a user