Improve BigO reporting, no bug, not part of the build

This commit is contained in:
bob%bclary.com 2005-11-24 04:54:52 +00:00
parent b756f93fe2
commit 7c234773e0
7 changed files with 56 additions and 6 deletions

View File

@ -52,7 +52,7 @@ function replace(str) {
}
function runTest() {
for (var j = 0; j <= 10000; j += 1000)
for (var j = 1000; j <= 10000; j += 1000)
{
neurodna(j);
}
@ -81,5 +81,5 @@ for (var p = 0; p < data.X.length; p++)
msg += '(' + data.X[p] + ', ' + data.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order);
reportCompare(true, order < 2, summary + ' BigO ' + order + ' < 2');

View File

@ -79,5 +79,20 @@ for (var x = 0; x < 5; x++)
var order1 = BigO(data1);
var order2 = BigO(data2);
var msg = '';
for (var p = 0; p < data1.X.length; p++)
{
msg += '(' + data1.X[p] + ', ' + data1.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order1);
reportCompare(true, order1 < 2 , summary + ' BigO ' + order1 + ' < 2');
msg = '';
for (var p = 0; p < data2.X.length; p++)
{
msg += '(' + data2.X[p] + ', ' + data2.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order2);
reportCompare(true, order2 < 2 , summary + ' BigO ' + order2 + ' < 2');

View File

@ -45,7 +45,7 @@ printBugNumber (bug);
printStatus (summary);
var data = {X:[], Y:[]};
for (var size = 100; size < 1000; size += 100)
for (var size = 5000; size <= 15000; size += 1000)
{
data.X.push(size);
data.Y.push(testSort(size));
@ -53,6 +53,13 @@ for (var size = 100; size < 1000; size += 100)
var order = BigO(data);
var msg = '';
for (var p = 0; p < data.X.length; p++)
{
msg += '(' + data.X[p] + ', ' + data.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order);
reportCompare(true, order < 2 , 'BigO ' + order + ' < 2');
function testSort(size)

View File

@ -45,7 +45,7 @@ printBugNumber (bug);
printStatus (summary);
var data = {X:[], Y:[]};
for (var size = 100; size < 1000; size += 100)
for (var size = 5000; size <= 15000; size += 1000)
{
data.X.push(size);
data.Y.push(testSort(size));
@ -53,6 +53,13 @@ for (var size = 100; size < 1000; size += 100)
var order = BigO(data);
var msg = '';
for (var p = 0; p < data.X.length; p++)
{
msg += '(' + data.X[p] + ', ' + data.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order);
reportCompare(true, order < 2 , 'BigO ' + order + ' < 2');
function testSort(size)

View File

@ -53,6 +53,13 @@ for (var size = 1000; size < 10000; size += 1000)
var order = BigO(data);
var msg = '';
for (var p = 0; p < data.X.length; p++)
{
msg += '(' + data.X[p] + ', ' + data.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order);
reportCompare(true, order < 2, 'BigO ' + order + ' < 2');
function concat(size)

View File

@ -45,7 +45,7 @@ printBugNumber (bug);
printStatus (summary);
var data = {X:[], Y:[]};
for (var size = 0; size <= 500; size += 100)
for (var size = 1000; size <= 10000; size += 1000)
{
data.X.push(size);
data.Y.push(concat(size));
@ -53,6 +53,13 @@ for (var size = 0; size <= 500; size += 100)
var order = BigO(data);
var msg = '';
for (var p = 0; p < data.X.length; p++)
{
msg += '(' + data.X[p] + ', ' + data.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order);
reportCompare(true, order < 2, 'BigO ' + order + ' < 2');
function concat(size)

View File

@ -45,7 +45,7 @@ printBugNumber (bug);
printStatus (summary);
var data = {X:[], Y:[]};
for (var size = 0; size <= 500; size += 100)
for (var size = 1000; size <= 10000; size += 1000)
{
data.X.push(size);
data.Y.push(concat(size));
@ -53,6 +53,13 @@ for (var size = 0; size <= 500; size += 100)
var order = BigO(data);
var msg = '';
for (var p = 0; p < data.X.length; p++)
{
msg += '(' + data.X[p] + ', ' + data.Y[p] + '); ';
}
printStatus(msg);
printStatus('Order: ' + order);
reportCompare(true, order < 2, 'BigO ' + order + ' < 2');
function concat(size)