Changeset: 1b233444f612 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1b233444f612
Modified Files:
        gdk/gdk_select.c
Branch: default
Log Message:

small perf test, ie use special loop for dense candidates in the string full 
scan with double elim (for now only for offset size == 1).


diffs (48 lines):

diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -1,7 +1,7 @@
 /*
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0.  If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
  *
  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
  */
@@ -628,14 +628,27 @@ fullscan_str(BAT *b, struct canditer *re
        case 1: {
                const unsigned char *ptr = (const unsigned char *) Tloc(b, 0);
                pos -= GDK_VAROFFSET;
-               for (p = 0; p < ci->ncand; p++) {
-                       o = canditer_next(ci);
-                       if (ptr[o - hseq] == pos) {
-                               buninsfix(bn, dst, cnt, o,
-                                         (BUN) ((dbl) cnt / (dbl) (p == 0 ? 1 
: p)
-                                                * (dbl) (ci->ncand-p) * 1.1 + 
1024),
-                                         maximum, BUN_NONE);
-                               cnt++;
+               if (ci->tpe == cand_dense) {
+                       for (p = 0; p < ci->ncand; p++) {
+                               o = canditer_next_dense(ci);
+                               if (ptr[o - hseq] == pos) {
+                                       buninsfix(bn, dst, cnt, o,
+                                               (BUN) ((dbl) cnt / (dbl) (p == 
0 ? 1 : p)
+                                                       * (dbl) (ci->ncand-p) * 
1.1 + 1024),
+                                               maximum, BUN_NONE);
+                                       cnt++;
+                               }
+                       }
+               } else {
+                       for (p = 0; p < ci->ncand; p++) {
+                               o = canditer_next(ci);
+                               if (ptr[o - hseq] == pos) {
+                                       buninsfix(bn, dst, cnt, o,
+                                               (BUN) ((dbl) cnt / (dbl) (p == 
0 ? 1 : p)
+                                                       * (dbl) (ci->ncand-p) * 
1.1 + 1024),
+                                               maximum, BUN_NONE);
+                                       cnt++;
+                               }
                        }
                }
                break;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to