From f7ce8bcbb300dc8a42b799323093ac187bd78a0f Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sun, 20 Aug 2017 21:31:07 +0200 Subject: [PATCH] Disable creating a date string to maybe use in a PINFO message. Creating a date string occupied nearly all of the time required to set a date on a transaction, generally to no benefit at all. --- libgnucash/engine/Transaction.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c index a0b4c158bc..a0c5b45f4d 100644 --- a/libgnucash/engine/Transaction.c +++ b/libgnucash/engine/Transaction.c @@ -1933,14 +1933,16 @@ xaccTransSetDateInternal(Transaction *trans, Timespec *dadate, Timespec val) { xaccTransBeginEdit(trans); - { +#if 0 /* gnc_ctime is expensive so change to 1 only if you need to debug setting + * dates. */ + { time64 secs = (time64) val.tv_sec; gchar *tstr = gnc_ctime (&secs); PINFO ("addr=%p set date to %" G_GUINT64_FORMAT ".%09ld %s\n", trans, val.tv_sec, val.tv_nsec, tstr ? tstr : "(null)"); g_free(tstr); } - +#endif *dadate = val; qof_instance_set_dirty(QOF_INSTANCE(trans)); mark_trans(trans);