Update of /cvsroot/monetdb/pathfinder/runtime
In directory sc8-pr-cvs16:/tmp/cvs-serv677/runtime
Modified Files:
ll_staircasejoin.mx
Log Message:
apply "poor man's binary search / exploiting forward scan"
also when skipping over candidates in ll_descendant().
Declaration/disclaimer:
-----------------------
On my FC6 desktop (64-bit, 64-bit OIDs, configured with --enable-optimize,
compiled with gcc 4.1.1), this check-in does not make any pathfinder test
fail that did not also fail with the most recent code base in CVS prior to
this check-in.
I did not check in detail, though, whether all previously failing tests
still fail the same way after this check-in as they did before this
check-in.
Index: ll_staircasejoin.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/runtime/ll_staircasejoin.mx,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- ll_staircasejoin.mx 11 May 2007 15:31:23 -0000 1.56
+++ ll_staircasejoin.mx 13 May 2007 11:39:21 -0000 1.57
@@ -653,7 +653,7 @@
int stack_size = 0, onstack_size = 0, iters_on_stack_size = 0, j = 0;
int stack_top = 0, ctx_bunsize = 0, iter_bunsize = 0, bs_cnd = 0;
oid pre = 0, ctx = 0, iter_idx = 0, cnd = 0, lst_cnd = GDK_oid_max;
- BUN iter_bun = 0, ctx_bun = 0, ctx_last = 0, cnd_bun = 0;
+ BUN iter_bun = 0, ctx_bun = 0, ctx_last = 0, cnd_bun = 0, cnd_lst = 0;
oid num_iters = (max_iter - min_iter) + 1, i;
int OST_bytes = sizeof(OST);
int OST_bits = OST_bytes * 8;
@@ -664,7 +664,8 @@
bs_cnd = BUNsize(cand_bat);
cnd_bun = BUNtloc(cand_bat, BUNfirst(cand_bat));
cnd = *(oid*)cnd_bun;
- lst_cnd = *(oid*)BUNtloc(cand_bat, BUNlast(cand_bat) - bs_cnd);
+ cnd_lst = BUNtloc(cand_bat, BUNlast(cand_bat) - bs_cnd);
+ lst_cnd = *(oid*)cnd_lst;
}
for (i=OST_mask; i; i>>=1) OST_shift++;
@@ -748,10 +749,18 @@
if (cand_bat) {
if (pre <= lst_cnd) {
if (cnd_bun) {
- while (cnd < pre) {
+ /* poor man's binary search / exploiting forward scan */
+ while (cnd_bun+1048576 <= cnd_lst && *(oid*)
(cnd_bun+1048576) < pre)
+ cnd_bun += 1048576; /* this avoids mmapped I/O */
+ while (cnd_bun+32768 <= cnd_lst && *(oid*) (cnd_bun+32768)
< pre)
+ cnd_bun += 32768;
+ while (cnd_bun+1024 <= cnd_lst && *(oid*) (cnd_bun+1024) <
pre)
+ cnd_bun += 1024;
+ while (cnd_bun+32 <= cnd_lst && *(oid*) (cnd_bun+32) < pre)
+ cnd_bun += 32;
+ while (*(oid*) cnd_bun < pre)
cnd_bun += bs_cnd;
- cnd = *(oid*)cnd_bun;
- }
+ cnd = *(oid*)cnd_bun;
} else {
if (cnd < pre) {
cnd = pre;
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins