PERFORCE change 147512 for review
Mayur Shardul
mayur at FreeBSD.org
Sat Aug 16 08:23:47 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=147512
Change 147512 by mayur at mayur_freebsd_vm on 2008/08/16 08:22:52
minor change to ignore malloc time in splay_insert
Affected files ...
.. //depot/projects/soc2008/mayur_vmalgo/uspace/rtree_stree.c#3 edit
.. //depot/projects/soc2008/mayur_vmalgo/uspace/splay_tree.c#3 edit
Differences ...
==== //depot/projects/soc2008/mayur_vmalgo/uspace/rtree_stree.c#3 (text+ko) ====
@@ -15,7 +15,7 @@
struct radix_tree *rtree;
int i,j;
int vals[N], lookups[N],inserts[N],removes[N];
- unsigned long long t_start, t_end;
+ unsigned long long t_start, t_end,t;
rtree = create_radix_tree(4);
for(i = 0; i < N; i++){
@@ -57,12 +57,11 @@
printf("TSC difference after inserts: %lld\n", (t_end - t_start));
printf("Measuring time for %d inserts on splay tree with"
"%d elements\n", N, X);
- t_start = rdtsc();
+ t = 0;
for(i = 0; i < N; i++){
- splay_insert(inserts[i]);
+ t += splay_insert(inserts[i]);
}
- t_end = rdtsc();
- printf("TSC difference after inserts: %lld\n", (t_end - t_start));
+ printf("TSC difference after inserts: %lld\n", (t));
printf("\n\n\nMeasuring time for %d removes on radix tree\n", N);
==== //depot/projects/soc2008/mayur_vmalgo/uspace/splay_tree.c#3 (text+ko) ====
@@ -41,5 +41,8 @@
unsigned long long start, end;
t->pindex = pindex;
+ start = rdtsc();
SPLAY_FIND(splay_tree, &stree, t);
+ end = rdtsc();
+ return (end - start);
}
More information about the p4-projects
mailing list