Changeset: 34e4b974ad06 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=34e4b974ad06
Modified Files:
        gdk/gdk_join.c
Branch: Oct2014
Log Message:

small optimizations (reduce amount of nil/sort checks for once we know it has 
nils or isn't sorted)


diffs (28 lines):

diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2770,17 +2770,22 @@ project_##TYPE(BAT *bn, BAT *l, BAT *r, 
                        if (nilcheck && v == TYPE##_nil && bn->T->nonil) { \
                                bn->T->nonil = 0;                       \
                                bn->T->nil = 1;                         \
+                               nilcheck = 0;                           \
                        }                                               \
                        if (sortcheck && lo &&                          \
                            (bn->trevsorted | bn->tsorted | bn->tkey)) { \
                                if (v > prev) {                         \
                                        bn->trevsorted = 0;             \
-                                       if (!bn->tsorted)               \
+                                       if (!bn->tsorted) {             \
                                                bn->tkey = 0; /* can't be sure 
*/ \
+                                               sortcheck = 0;          \
+                                       }                               \
                                } else if (v < prev) {                  \
                                        bn->tsorted = 0;                \
-                                       if (!bn->trevsorted)            \
+                                       if (!bn->trevsorted) {          \
                                                bn->tkey = 0; /* can't be sure 
*/ \
+                                               sortcheck = 0;          \
+                                       }                               \
                                } else {                                \
                                        bn->tkey = 0; /* definitely */  \
                                }                                       \
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to