Changeset: 57888038e580 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=57888038e580
Modified Files:
gdk/gdk_batop.c
Branch: Jun2020
Log Message:
Debug message for BATappend.
diffs (64 lines):
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -496,6 +496,8 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f
BUN r;
PROPrec *prop, *nprop;
oid hseq = n->hseqbase;
+ char buf[64];
+ lng t0 = 0;
if (b == NULL || n == NULL || (cnt = BATcount(n)) == 0) {
return GDK_SUCCEED;
@@ -503,6 +505,11 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f
assert(b->batCacheid > 0);
assert(b->theap.parentid == 0);
+ TRC_DEBUG_IF(ALGO) {
+ t0 = GDKusec();
+ snprintf(buf, sizeof(buf), ALGOBATFMT, ALGOBATPAR(b));
+ }
+
ALIGNapp(b, force, GDK_FAIL);
if (ATOMstorage(ATOMtype(b->ttype)) != ATOMstorage(ATOMtype(n->ttype)))
{
@@ -518,7 +525,7 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f
cnt = canditer_init(&ci, n, s);
if (cnt == 0) {
- return GDK_SUCCEED;
+ goto doreturn;
}
if (BUNlast(b) + cnt > BUN_MAX) {
@@ -585,14 +592,14 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f
if (BATcount(b) == 0)
BATtseqbase(b, n->tseqbase + ci.seq - hseq);
BATsetcount(b, BATcount(b) + cnt);
- return GDK_SUCCEED;
+ goto doreturn;
}
if ((BATcount(b) == 0 || is_oid_nil(b->tseqbase)) &&
n->ttype == TYPE_void && is_oid_nil(n->tseqbase)) {
/* both b and n are void/nil */
BATtseqbase(b, oid_nil);
BATsetcount(b, BATcount(b) + cnt);
- return GDK_SUCCEED;
+ goto doreturn;
}
/* we need to materialize b; allocate enough capacity */
b->batCapacity = BATcount(b) + cnt;
@@ -707,6 +714,13 @@ BATappend(BAT *b, BAT *n, BAT *s, bool f
}
if (b->thash)
BATsetprop(b, GDK_NUNIQUE, TYPE_oid, &(oid){b->thash->nunique});
+
+ doreturn:
+ TRC_DEBUG(ALGO, "b=%s,n=" ALGOBATFMT ",s=" ALGOOPTBATFMT
+ " -> " ALGOBATFMT " (" LLFMT " usec)\n",
+ buf, ALGOBATPAR(n), ALGOOPTBATPAR(s), ALGOBATPAR(b),
+ GDKusec() - t0);
+
return GDK_SUCCEED;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list