[gnumeric] data-source: one recalc per block, not one per line.



commit 879bdbf614c3ff1d0d17995d2cefb65f66ff5da1
Author: Morten Welinder <terra gnome org>
Date:   Thu May 28 12:42:37 2020 -0400

    data-source: one recalc per block, not one per line.

 NEWS                                          | 5 ++++-
 plugins/sample_datasource/sample_datasource.c | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index a3462ab41..d22dd8b28 100644
--- a/NEWS
+++ b/NEWS
@@ -5,7 +5,10 @@ Andreas:
        * Fix line end marker roundtrip through strict ODF
        * Improve export of line markers to ODF for interoperability
        * Improve line marker handling on import
-    * Fix LaTeX export. [#489]
+       * Fix LaTeX export. [#489]
+
+Morten:
+       * Fix performace issue with sample_datasource.  [#491]
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.47
diff --git a/plugins/sample_datasource/sample_datasource.c b/plugins/sample_datasource/sample_datasource.c
index 36e990a91..a3666ad03 100644
--- a/plugins/sample_datasource/sample_datasource.c
+++ b/plugins/sample_datasource/sample_datasource.c
@@ -102,13 +102,13 @@ cb_watcher_queue_recalc (gpointer key, gpointer value, gpointer closure)
 {
        Watcher const *w = key;
        dependent_queue_recalc (w->dep);
-       gnm_app_recalc ();
 }
 
 static gboolean
 cb_atl_input (GIOChannel *gioc, GIOCondition cond, gpointer ignored)
 {
        char buf[128];
+       gboolean any = FALSE;
 
        /* quick format ticker:value\n
         * there is no notion of a field for now.
@@ -130,10 +130,13 @@ cb_atl_input (GIOChannel *gioc, GIOCondition cond, gpointer ignored)
 
                                g_hash_table_foreach (wv->deps,
                                        cb_watcher_queue_recalc, NULL);
+                               any = TRUE;
                                g_printerr ("'%s' <= %" GNM_FORMAT_f "\n", sym, val);
                        }
                }
        }
+       if (any)
+               gnm_app_recalc ();
 
        return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]