Skip to content
Snippets Groups Projects
Commit c1e6807d authored by Andreas Gohr's avatar Andreas Gohr
Browse files

removed outdated timing tests

parent cf1b22ac
No related branches found
No related tags found
No related merge requests found
......@@ -56,66 +56,5 @@ class indexer_idx_indexlengths_test extends UnitTestCase {
}
}
class indexer_idx_indexlengths_time extends UnitTestCase {
/**
* Test the time improvments of the new function
* Time reference for 10000 call oneWords: 4,6s
* It's 90% faster
*/
function test_oneWord(){
global $conf;
$filter[8] = array('dokuwiki');
$start = microtime(true);
for ($i = 0; $i < 10000; $i++) {
$result = idx_indexLengths(&$filter);
}
$end = microtime(true);
$time = $end - $start;
$timeref = 4.6*0.10; // actual execution time of 4,6s for 10000 calls
echo "1) 10% ref : $timeref -> $time \n";
$this->assertTrue($time < $timeref);
}
/**
* Test the time improvments of the new function
* Time reference for 10000 call moreWords: 4,6s
* It's 90% faster
*/
function test_moreWords() {
global $conf;
$filter = array( 4 => array('test'), 8 => array('dokuwiki'), 7 => array('powered'));
// more words should return the indexes
$start = microtime(true);
for ($i = 0; $i < 10000; $i++) {
$result = idx_indexLengths(&$filter);
}
$end = microtime(true);
$time = $end - $start;
$timeref = 4.6*0.10; // actual execution time of 4,6s for 10000 calls
echo "2) 10% ref : $timeref -> $time \n";
$this->assertTrue($time < $timeref);
}
/**
* Test the time improvments of the new function
* Time reference for 10000 call on minValue: 4,9s
* Sould be at least 65% faster
* Test fail with no cache
*/
function test_minValue() {
global $conf;
$filter = 5;
$start = microtime(true);
for ($i = 0; $i < 10000; $i++) {
$result = idx_indexLengths(&$filter);
}
$end = microtime(true);
$time = $end - $start;
$timeref = 4.9 * 0.35; // actual execution time of 4,9s for 10000 calls
echo "3) 35% ref : $timeref -> $time \n";
$this->assertTrue($time < $timeref);
}
}
//Setup VIM: ex: et ts=4 enc=utf-8 :
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment