зеркало из https://github.com/mozilla/gecko-dev.git
Bug 75405 js benchmarks need strict mode cleaning
patch by petejc@collab.net r=rogerl
This commit is contained in:
Родитель
0e996b7cf4
Коммит
08a077d57d
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
var total="";
|
||||||
print("add_bench");
|
print("add_bench");
|
||||||
|
|
||||||
// add two double parameters
|
// add two double parameters
|
||||||
|
@ -106,7 +107,6 @@ function addDouble_V()
|
||||||
function addDouble_VK(d1)
|
function addDouble_VK(d1)
|
||||||
{
|
{
|
||||||
var t;
|
var t;
|
||||||
var d1 = 2.781828;
|
|
||||||
var startTime = new Date();
|
var startTime = new Date();
|
||||||
|
|
||||||
for (var i = 0; i < 5000; i++) {
|
for (var i = 0; i < 5000; i++) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("array_bench");
|
print("array_bench");
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("branch_bench");
|
print("branch_bench");
|
||||||
|
|
||||||
|
|
||||||
|
@ -259,4 +260,4 @@ branch_P(gB, gA, "SL");
|
||||||
|
|
||||||
for_K();
|
for_K();
|
||||||
for_V(1000000);
|
for_V(1000000);
|
||||||
for_P(1000000);
|
for_P(1000000);
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
function f() {
|
function f() {
|
||||||
var o;
|
var o;
|
||||||
for (var i=0; i < 1000; i++) {
|
for (var i=0; i < 1000; i++) {
|
||||||
o = new Object();
|
o = new Object();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
f();
|
f();
|
||||||
print("took", (new Date()) - d, "ms.");
|
print("took", (new Date()) - d, "ms.");
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("eval_bench.js");
|
print("eval_bench.js");
|
||||||
|
|
||||||
// assign to a var from within an eval
|
// assign to a var from within an eval
|
||||||
|
@ -36,4 +37,4 @@ function eval_1()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
eval_1();
|
eval_1();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("func_bench");
|
print("func_bench");
|
||||||
|
|
||||||
// call a function with zero parameters, returning nothing
|
// call a function with zero parameters, returning nothing
|
||||||
|
@ -296,4 +296,4 @@ call_1B();
|
||||||
call_2B();
|
call_2B();
|
||||||
call_4B();
|
call_4B();
|
||||||
call_8B();
|
call_8B();
|
||||||
call_4P(gP0, gP1, gP2, gP3);
|
call_4P(gP0, gP1, gP2, gP3);
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
var total;
|
||||||
|
|
||||||
if (typeof total == "undefined")
|
if (typeof total == "undefined")
|
||||||
total = 0;
|
total = 0;
|
||||||
|
@ -261,6 +262,10 @@ function getProp_3()
|
||||||
// get different properties from the this object
|
// get different properties from the this object
|
||||||
function getProp_3a()
|
function getProp_3a()
|
||||||
{
|
{
|
||||||
|
//for(var list in this.prop1)
|
||||||
|
//print(list);
|
||||||
|
//return;
|
||||||
|
|
||||||
var t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
var t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
||||||
var startTime = new Date();
|
var startTime = new Date();
|
||||||
|
|
||||||
|
@ -395,7 +400,16 @@ getProp_2b();
|
||||||
var tP = { };
|
var tP = { };
|
||||||
tP.doit = getProp_3;
|
tP.doit = getProp_3;
|
||||||
tP.doit2 = getProp_3a;
|
tP.doit2 = getProp_3a;
|
||||||
|
tP.prop0 = { };
|
||||||
tP.prop1 = { };
|
tP.prop1 = { };
|
||||||
|
tP.prop2 = { };
|
||||||
|
tP.prop3 = { };
|
||||||
|
tP.prop4 = { };
|
||||||
|
tP.prop5 = { };
|
||||||
|
tP.prop6 = { };
|
||||||
|
tP.prop7 = { };
|
||||||
|
tP.prop8 = { };
|
||||||
|
tP.prop9 = { };
|
||||||
tP.doit();
|
tP.doit();
|
||||||
tP.doit2();
|
tP.doit2();
|
||||||
|
|
||||||
|
@ -436,9 +450,9 @@ deepGet_2();
|
||||||
// get different properties from the same object in script scope, at script scope
|
// get different properties from the same object in script scope, at script scope
|
||||||
|
|
||||||
var t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
var t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
||||||
var startTime = new Date();
|
startTime = new Date();
|
||||||
|
|
||||||
for (var i = 0; i < 5000; i++) {
|
for (i = 0; i < 5000; i++) {
|
||||||
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
||||||
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
||||||
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
||||||
|
@ -460,16 +474,16 @@ deepGet_2();
|
||||||
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
||||||
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
t0 = gP.prop0; t1 = gP.prop1; t2 = gP.prop2; t3 = gP.prop3; t4 = gP.prop4; t5 = gP.prop5; t6 = gP.prop6; t7 = gP.prop7; t8 = gP.prop8; t9 = gP.prop9;
|
||||||
}
|
}
|
||||||
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("getProp_Sa : " + elapsedTime);
|
print("getProp_Sa : " + elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
|
|
||||||
// get different properties from different objects in script scope, at script scope
|
// get different properties from different objects in script scope, at script scope
|
||||||
|
|
||||||
var t0, t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
//var t1, t2, t3, t4, t5, t6, t7, t8, t9;
|
||||||
var startTime = new Date();
|
startTime = new Date();
|
||||||
|
|
||||||
for (var i = 0; i < 5000; i++) {
|
for (i = 0; i < 5000; i++) {
|
||||||
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
||||||
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
||||||
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
||||||
|
@ -491,6 +505,6 @@ deepGet_2();
|
||||||
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
||||||
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
t0 = gP0.prop0; t1 = gP1.prop1; t2 = gP2.prop2; t3 = gP3.prop3; t4 = gP4.prop4; t5 = gP5.prop5; t6 = gP6.prop6; t7 = gP7.prop7; t8 = gP8.prop8; t9 = gP9.prop9;
|
||||||
}
|
}
|
||||||
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("getProp_Sb : " + elapsedTime);
|
print("getProp_Sb : " + elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("inc_bench");
|
print("inc_bench");
|
||||||
|
|
||||||
// increment a parameter
|
// increment a parameter
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("math_bench");
|
print("math_bench");
|
||||||
|
|
||||||
function math_V()
|
function math_V()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
var total="";
|
||||||
print("misc_bench");
|
print("misc_bench");
|
||||||
|
|
||||||
document_1 = { };
|
var document_1 = { };
|
||||||
document_1.live = { };
|
document_1.live = { };
|
||||||
document_1.live.age = { };
|
document_1.live.age = { };
|
||||||
document_1.live.age.value = "june 18, 1961";
|
document_1.live.age.value = "june 18, 1961";
|
||||||
|
@ -9,30 +9,30 @@ document_1.live.time1 = { };
|
||||||
document_1.live.time2 = { };
|
document_1.live.time2 = { };
|
||||||
document_1.live.time3 = { };
|
document_1.live.time3 = { };
|
||||||
|
|
||||||
window = { };
|
var window = { };
|
||||||
|
|
||||||
function setTimeout()
|
function setTimeout()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
function lifetimer(){
|
function lifetimer(){
|
||||||
today = new Date()
|
var today = new Date()
|
||||||
BirthDay = new Date(document_1.live.age.value)
|
var BirthDay = new Date(document_1.live.age.value)
|
||||||
|
var timeold = (today.getTime() - BirthDay.getTime());
|
||||||
|
var sectimeold = timeold / 1000;
|
||||||
|
var secondsold = Math.floor(sectimeold);
|
||||||
|
var msPerDay = 24 * 60 * 60 * 1000 ;
|
||||||
timeold = (today.getTime() - BirthDay.getTime());
|
timeold = (today.getTime() - BirthDay.getTime());
|
||||||
sectimeold = timeold / 1000;
|
var e_daysold = timeold / msPerDay;
|
||||||
secondsold = Math.floor(sectimeold);
|
var daysold = Math.floor(e_daysold);
|
||||||
msPerDay = 24 * 60 * 60 * 1000 ;
|
var e_hrsold = (e_daysold - daysold)*24;
|
||||||
timeold = (today.getTime() - BirthDay.getTime());
|
var hrsold = Math.floor(e_hrsold);
|
||||||
e_daysold = timeold / msPerDay;
|
var minsold = Math.floor((e_hrsold - hrsold)*60);
|
||||||
daysold = Math.floor(e_daysold);
|
|
||||||
e_hrsold = (e_daysold - daysold)*24;
|
|
||||||
hrsold = Math.floor(e_hrsold);
|
|
||||||
minsold = Math.floor((e_hrsold - hrsold)*60);
|
|
||||||
document_1.live.time1.value = daysold
|
document_1.live.time1.value = daysold
|
||||||
document_1.live.time2.value = hrsold
|
document_1.live.time2.value = hrsold
|
||||||
document_1.live.time3.value = minsold
|
document_1.live.time3.value = minsold
|
||||||
window.status = "Well at the moment you are " + secondsold + "............ seconds old.";
|
window.status = "Well at the moment you are " + secondsold + "............ seconds old.";
|
||||||
timerID = setTimeout("lifetimer()",1000)
|
var timerID = setTimeout("lifetimer()",1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
function misc_1()
|
function misc_1()
|
||||||
|
@ -40,7 +40,7 @@ function misc_1()
|
||||||
var startTime = new Date();
|
var startTime = new Date();
|
||||||
for (var i = 0; i < 5000; i++)
|
for (var i = 0; i < 5000; i++)
|
||||||
lifetimer();
|
lifetimer();
|
||||||
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("misc_1 : ", elapsedTime);
|
print("misc_1 : ", elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ function MakeArray(n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Initialize Days of Week Array
|
//Initialize Days of Week Array
|
||||||
days = new MakeArray(7);
|
var days = new MakeArray(7);
|
||||||
days[0] = "Saturday"
|
days[0] = "Saturday"
|
||||||
days[1] = "Sunday"
|
days[1] = "Sunday"
|
||||||
days[2] = "Monday"
|
days[2] = "Monday"
|
||||||
|
@ -64,7 +64,7 @@ days[5] = "Thursday"
|
||||||
days[6] = "Friday"
|
days[6] = "Friday"
|
||||||
|
|
||||||
//Initialize Months Array
|
//Initialize Months Array
|
||||||
months = new MakeArray(12);
|
var months = new MakeArray(12);
|
||||||
months[1] = "January"
|
months[1] = "January"
|
||||||
months[2] = "February"
|
months[2] = "February"
|
||||||
months[3] = "March"
|
months[3] = "March"
|
||||||
|
@ -78,7 +78,7 @@ months[10] = "October"
|
||||||
months[11] = "November"
|
months[11] = "November"
|
||||||
months[12] = "December"
|
months[12] = "December"
|
||||||
|
|
||||||
form = { };
|
var form = { };
|
||||||
form.day = { };
|
form.day = { };
|
||||||
form.day.value = "14";
|
form.day.value = "14";
|
||||||
form.month = { };
|
form.month = { };
|
||||||
|
@ -128,7 +128,7 @@ function misc_2()
|
||||||
for (var i = 0; i < 5000; i++) {
|
for (var i = 0; i < 5000; i++) {
|
||||||
compute(form); compute(form);
|
compute(form); compute(form);
|
||||||
}
|
}
|
||||||
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("misc_2 : ", elapsedTime);
|
print("misc_2 : ", elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ function misc_2()
|
||||||
// http://www.geocities.com/SiliconValley/Heights/2052
|
// http://www.geocities.com/SiliconValley/Heights/2052
|
||||||
// Copyright 1996 Chris Englmeier
|
// Copyright 1996 Chris Englmeier
|
||||||
|
|
||||||
Input = { };
|
var Input = { };
|
||||||
Input.value = 4096;
|
Input.value = 4096;
|
||||||
|
|
||||||
function Newton(Input){
|
function Newton(Input){
|
||||||
|
@ -160,7 +160,7 @@ function misc_3()
|
||||||
for (var i = 0; i < 5000; i++) {
|
for (var i = 0; i < 5000; i++) {
|
||||||
Newton(Input); Newton(Input); Newton(Input); Newton(Input); Newton(Input); Newton(Input);
|
Newton(Input); Newton(Input); Newton(Input); Newton(Input); Newton(Input); Newton(Input);
|
||||||
}
|
}
|
||||||
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("misc_3 : ", elapsedTime);
|
print("misc_3 : ", elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
}
|
}
|
||||||
|
@ -181,8 +181,8 @@ var al=" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
var ns="0123456789";
|
var ns="0123456789";
|
||||||
|
|
||||||
function iA(){
|
function iA(){
|
||||||
this.length=iA.arguments.length;
|
// this.length=iA.arguments.length; // strict warning: deprecated arguments usage
|
||||||
for (var i=0;i<this.length;i++){
|
for (var i=0;i<arguments.length;i++){
|
||||||
this[i]=iA.arguments[i];
|
this[i]=iA.arguments[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -314,7 +314,7 @@ b[1]=10;
|
||||||
b[2]=100;
|
b[2]=100;
|
||||||
b[3]=1000;
|
b[3]=1000;
|
||||||
|
|
||||||
document_2 = { };
|
var document_2 = { };
|
||||||
document_2.isn = { };
|
document_2.isn = { };
|
||||||
document_2.isn.isn1 = { };
|
document_2.isn.isn1 = { };
|
||||||
document_2.isn.isn1.selectedIndex = 60;
|
document_2.isn.isn1.selectedIndex = 60;
|
||||||
|
@ -332,17 +332,17 @@ document_2.isn.rb[1].checked = false;
|
||||||
document_2.isn.disp = { };
|
document_2.isn.disp = { };
|
||||||
|
|
||||||
function getMiles(form){
|
function getMiles(form){
|
||||||
lf=(document_2.isn.isn1.options[document_2.isn.isn1.selectedIndex].value);
|
var lf=(document_2.isn.isn1.options[document_2.isn.isn1.selectedIndex].value);
|
||||||
rf=(document_2.isn.isn2.options[document_2.isn.isn2.selectedIndex].value);
|
var rf=(document_2.isn.isn2.options[document_2.isn.isn2.selectedIndex].value);
|
||||||
l=al.indexOf(lf);
|
var l=al.indexOf(lf);
|
||||||
r=al.indexOf(rf);
|
var r=al.indexOf(rf);
|
||||||
if (r<l){
|
if (r<l){
|
||||||
l=r;
|
l=r;
|
||||||
r=al.indexOf(lf);
|
r=al.indexOf(lf);
|
||||||
}
|
}
|
||||||
ls=a[l];
|
var ls=a[l];
|
||||||
pos=ls.indexOf("*")
|
var pos=ls.indexOf("*")
|
||||||
ls1="From "+ls.substring(0,pos)+" to "
|
var ls1="From "+ls.substring(0,pos)+" to "
|
||||||
+a[r].substring(0,a[r].indexOf("*"))+" is about ";
|
+a[r].substring(0,a[r].indexOf("*"))+" is about ";
|
||||||
ls=ls.substring(pos+1,ls.length);
|
ls=ls.substring(pos+1,ls.length);
|
||||||
tc=ls.substring(((r*2)-(l*2)),ls.length);
|
tc=ls.substring(((r*2)-(l*2)),ls.length);
|
||||||
|
@ -354,7 +354,8 @@ function getMiles(form){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function dispMi(){
|
function dispMi(){
|
||||||
ch=tc.charAt(0);
|
var ls1="";
|
||||||
|
var ch=tc.charAt(0);
|
||||||
ls1+=al.indexOf(ch);
|
ls1+=al.indexOf(ch);
|
||||||
ch=tc.charAt(1);
|
ch=tc.charAt(1);
|
||||||
if (ch!=" "){
|
if (ch!=" "){
|
||||||
|
@ -398,7 +399,7 @@ function misc_4()
|
||||||
for (var i = 0; i < 1000; i++) {
|
for (var i = 0; i < 1000; i++) {
|
||||||
getMiles();
|
getMiles();
|
||||||
}
|
}
|
||||||
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("misc_4 : ", elapsedTime);
|
print("misc_4 : ", elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
}
|
}
|
||||||
|
@ -406,4 +407,4 @@ function misc_4()
|
||||||
misc_1();
|
misc_1();
|
||||||
misc_2();
|
misc_2();
|
||||||
misc_3();
|
misc_3();
|
||||||
misc_4();
|
misc_4();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("new_bench");
|
print("new_bench");
|
||||||
|
|
||||||
// construct (and release) lots of objects
|
// construct (and release) lots of objects
|
||||||
|
@ -35,4 +35,4 @@ function new_1()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
new_1();
|
new_1();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
var total="";
|
||||||
print("setProp_bench");
|
print("setProp_bench");
|
||||||
|
|
||||||
// set the same property into the same object, passed as a parameter
|
// set the same property into the same object, passed as a parameter
|
||||||
|
@ -478,9 +478,9 @@ deepSet_2();
|
||||||
var t7 = { };
|
var t7 = { };
|
||||||
var t8 = { };
|
var t8 = { };
|
||||||
var t9 = { };
|
var t9 = { };
|
||||||
var startTime = new Date();
|
startTime = new Date();
|
||||||
|
|
||||||
for (var i = 0; i < 5000; i++) {
|
for (i = 0; i < 5000; i++) {
|
||||||
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
||||||
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
||||||
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
||||||
|
@ -502,25 +502,25 @@ deepSet_2();
|
||||||
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
||||||
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
gP.prop0 = t0; gP.prop1 = t1; gP.prop2 = t2; gP.prop3 = t3; gP.prop4 = t4; gP.prop5 = t5; gP.prop6 = t6; gP.prop7 = t7; gP.prop8 = t8; gP.prop9 = t9;
|
||||||
}
|
}
|
||||||
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("setProp_Sa : " + elapsedTime);
|
print("setProp_Sa : " + elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
|
|
||||||
|
|
||||||
// set different properties into different objects in script scope, at script scope
|
// set different properties into different objects in script scope, at script scope
|
||||||
var t0 = { };
|
t0 = { };
|
||||||
var t1 = { };
|
t1 = { };
|
||||||
var t2 = { };
|
t2 = { };
|
||||||
var t3 = { };
|
t3 = { };
|
||||||
var t4 = { };
|
t4 = { };
|
||||||
var t5 = { };
|
t5 = { };
|
||||||
var t6 = { };
|
t6 = { };
|
||||||
var t7 = { };
|
t7 = { };
|
||||||
var t8 = { };
|
t8 = { };
|
||||||
var t9 = { };
|
t9 = { };
|
||||||
var startTime = new Date();
|
startTime = new Date();
|
||||||
|
|
||||||
for (var i = 0; i < 5000; i++) {
|
for (i = 0; i < 5000; i++) {
|
||||||
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
||||||
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
||||||
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
||||||
|
@ -542,6 +542,6 @@ deepSet_2();
|
||||||
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
||||||
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
gP0.prop0 = t0; gP1.prop1 = t1; gP2.prop2 = t2; gP3.prop3 = t3; gP4.prop4 = t4; gP5.prop5 = t5; gP6.prop6 = t6; gP7.prop7 = t7; gP8.prop8 = t8; gP9.prop9 = t9;
|
||||||
}
|
}
|
||||||
var elapsedTime = (new Date()).getTime() - startTime.getTime();
|
elapsedTime = (new Date()).getTime() - startTime.getTime();
|
||||||
print("setProp_Sb : " + elapsedTime);
|
print("setProp_Sb : " + elapsedTime);
|
||||||
total += elapsedTime;
|
total += elapsedTime;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче