Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2431 → Rev 2450

/branches/rcu/kernel/test/timeout/timeoutbench1.c
41,9 → 41,9
/*
* Node count must be more then 1000!
*/
#define NODE_COUNT 1000000
#define NODE_COUNT 100000
#define GEN_NUM 275604541
#define OPERATION_COUNT 100000000
#define OPERATION_COUNT 1000000
#define TEST_COUNT 3
 
static unsigned int node_count[TEST_COUNT] = {100,1000,NODE_COUNT};
229,7 → 229,6
*/
static void test1(void)
{
ipl_t ipl;
uint64_t s[3][TEST_COUNT],f[3][TEST_COUNT];
uint64_t ds[3][TEST_COUNT],df[3][TEST_COUNT];
unsigned int i,ii;
247,7 → 246,6
/*
* AVL INSERT
*/
ipl = interrupts_disable();
s[0][ii] = get_cycle();
avltree_create(&avltree);
256,11 → 254,9
}
f[0][ii] = get_cycle();
interrupts_restore(ipl);
/*
* AVL DELETE
*/
ipl = interrupts_disable();
ds[0][ii] = get_cycle();
while ((a = avltree.root) != NULL) {
269,12 → 265,10
}
df[0][ii] = get_cycle();
interrupts_restore(ipl);
 
/*
* ExtAVL INSERT
*/
ipl = interrupts_disable();
s[1][ii] = get_cycle();
extavltree_create(&extavltree);
283,11 → 277,9
}
f[1][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVL DELETE
*/
ipl = interrupts_disable();
ds[1][ii] = get_cycle();
while ((b = extavltree.root) != NULL) {
296,12 → 288,10
}
df[1][ii] = get_cycle();
interrupts_restore(ipl);
 
/*
* ExtAVLrel INSERT
*/
ipl = interrupts_disable();
s[2][ii] = get_cycle();
extavlreltree_create(&extavlreltree);
310,11 → 300,9
}
f[2][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVLrel DELETE
*/
ipl = interrupts_disable();
ds[2][ii] = get_cycle();
while ((c = extavlreltree.root) != NULL) {
323,7 → 311,6
}
df[2][ii] = get_cycle();
interrupts_restore(ipl);
}
printf("\n----------------------------------------------------------------------------");
printf("\nAVL\t\t");
359,7 → 346,6
*/
static void test2(void)
{
ipl_t ipl;
uint64_t s[3][TEST_COUNT],f[3][TEST_COUNT];
uint64_t ds[3][TEST_COUNT],df[3][TEST_COUNT];
unsigned int i,ii;
377,7 → 363,6
/*
* AVL INSERT
*/
ipl = interrupts_disable();
s[0][ii] = get_cycle();
avltree_create(&avltree);
386,11 → 371,9
}
f[0][ii] = get_cycle();
interrupts_restore(ipl);
/*
* AVL DELETE
*/
ipl = interrupts_disable();
ds[0][ii] = get_cycle();
while (avltree.root != NULL) {
400,12 → 383,10
}
df[0][ii] = get_cycle();
interrupts_restore(ipl);
 
/*
* ExtAVL INSERT
*/
ipl = interrupts_disable();
s[1][ii] = get_cycle();
extavltree_create(&extavltree);
414,11 → 395,9
}
f[1][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVL DELETE
*/
ipl = interrupts_disable();
ds[1][ii] = get_cycle();
while (extavltree.root != NULL) {
428,11 → 407,9
}
df[1][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVLrel INSERT
*/
ipl = interrupts_disable();
s[2][ii] = get_cycle();
extavlreltree_create(&extavlreltree);
441,11 → 418,9
}
f[2][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVLrel DELETE
*/
ipl = interrupts_disable();
ds[2][ii] = get_cycle();
while (extavlreltree.root != NULL) {
455,7 → 430,6
}
df[2][ii] = get_cycle();
interrupts_restore(ipl);
}
printf("\n----------------------------------------------------------------------------");
printf("\nAVL\t\t");
491,7 → 465,6
*/
static void test3(void)
{
ipl_t ipl;
uint64_t s[3][TEST_COUNT],f[3][TEST_COUNT];
uint64_t ds[3][TEST_COUNT],df[3][TEST_COUNT];
unsigned int i,ii;
509,7 → 482,6
/*
* AVL INSERT
*/
ipl = interrupts_disable();
s[0][ii] = get_cycle();
avltree_create(&avltree);
518,11 → 490,9
}
f[0][ii] = get_cycle();
interrupts_restore(ipl);
/*
* AVL DELETE
*/
ipl = interrupts_disable();
ds[0][ii] = get_cycle();
while (avltree.root != NULL) {
532,12 → 502,10
}
df[0][ii] = get_cycle();
interrupts_restore(ipl);
 
/*
* ExtAVL INSERT
*/
ipl = interrupts_disable();
s[1][ii] = get_cycle();
extavltree_create(&extavltree);
546,11 → 514,9
}
f[1][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVL DELETE
*/
ipl = interrupts_disable();
ds[1][ii] = get_cycle();
while (extavltree.root != NULL) {
560,11 → 526,9
}
df[1][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVLrel INSERT
*/
ipl = interrupts_disable();
s[2][ii] = get_cycle();
extavlreltree_create(&extavlreltree);
573,11 → 537,9
}
f[2][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVLrel DELETE
*/
ipl = interrupts_disable();
ds[2][ii] = get_cycle();
while (extavlreltree.root != NULL) {
587,7 → 549,6
}
df[2][ii] = get_cycle();
interrupts_restore(ipl);
}
printf("\n----------------------------------------------------------------------------");
printf("\nAVL\t\t");
623,7 → 584,6
*/
static void test4(void)
{
ipl_t ipl;
uint64_t s[3][TEST_COUNT],f[3][TEST_COUNT];
unsigned int i,ii;
avltree_node_t *a;
647,7 → 607,6
*/
rr = r;
nc = 0;
ipl = interrupts_disable();
s[0][ii] = get_cycle();
avltree_create(&avltree);
681,7 → 640,6
}
f[0][ii] = get_cycle();
interrupts_restore(ipl);
 
/*
* ExtAVL
688,7 → 646,6
*/
rr = r;
nc = 0;
ipl = interrupts_disable();
s[1][ii] = get_cycle();
extavltree_create(&extavltree);
722,7 → 679,6
}
 
f[1][ii] = get_cycle();
interrupts_restore(ipl);
/*
* ExtAVLrel
729,7 → 685,6
*/
rr = r;
nc = 0;
ipl = interrupts_disable();
s[2][ii] = get_cycle();
extavlreltree_create(&extavlreltree);
765,7 → 720,6
}
 
f[2][ii] = get_cycle();
interrupts_restore(ipl);
}
printf("\n----------------------------------------------------------------------------");
printf("\nAVL\t\t");
795,11 → 749,9
return NULL;
 
/*
* Disable interrupts,
* store initial cycle count,
* do test,
* store finish cycle count,
* enable interrupts,
* show results
*/