pspp-dev
[Top][All Lists]
Advanced

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

Bug #47090


From: John Darrington
Subject: Bug #47090
Date: Wed, 24 Feb 2016 17:21:36 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

I think that once Bug #47090  and Bug #42086 have been fixed, so
long as no new issues have arisen, it will be time to make a new
release.

Regarding Bug #47090:

In our current git HEAD operations on the sheet are of complexity
O(n^2) in the number of columns.  This means that operations on data,
when there are a large number of variables are unacceptably slow.
I have to wait longer than 5 minutes for an operation on 2500 variables
to complete (it is almost instantaneous without the GUI).

Ideally, these operations can be done with O(1) complexity, and that
is what happens with the "efficient-sheet" I have been working on.
However that is not going to be ready for public consumption in the
next few weeks.

In release 0.8.5 this operation was O(n) so I think we should look
for a short term solution which restores this behaviour.

I can see two possible solutions:

Solution 1:

Revert commit 8298a4c6e326a39e204ca58d686497758333a102.

This commit by Friedrich appears to have undone an earlier optimisation.
Friedrich can be elaborate on the bug you noticed which prompted you
to make this commit?  Maybe there is another solution?



Solution 2:

The patch below fixes the time complexity, and so far as I can see
introduces no adverse effects.  However I haven't done any very
thorough testing.

It removes a loop which calls _pspp_sheet_view_column_cell_set_dirty
on all the columns.  Note that the function 
_pspp_sheet_view_column_cell_set_dirty
sets a flag:
  tree_column->dirty = TRUE;
but there is nothing in our code which reads this flag or unsets it.
Perhaps it is here only for historical reasons?







From 54d20e902513f7a890c727cc45d31dceb64679ed Mon Sep 17 00:00:00 2001
From: John Darrington <address@hidden>
Date: Wed, 24 Feb 2016 09:21:36 +0100
Subject: [PATCH] pspp-sheet-view.c: Remove inner loop from column insertion
 and removal operations

This appears to do no harm and moves the complexity from O(n^2) to O(n).


From 54d20e902513f7a890c727cc45d31dceb64679ed Mon Sep 17 00:00:00 2001
From: John Darrington <address@hidden>
Date: Wed, 24 Feb 2016 09:21:36 +0100
Subject: [PATCH] pspp-sheet-view.c: Remove inner loop from column insertion
 and removal operations

This appears to do no harm and moves the complexity from O(n^2) to O(n).
---
 src/ui/gui/pspp-sheet-view.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/src/ui/gui/pspp-sheet-view.c b/src/ui/gui/pspp-sheet-view.c
index fe70504..7ff7569 100644
--- a/src/ui/gui/pspp-sheet-view.c
+++ b/src/ui/gui/pspp-sheet-view.c
@@ -8927,14 +8927,6 @@ pspp_sheet_view_remove_column (PsppSheetView       
*tree_view,
       GList *list;
 
       _pspp_sheet_view_column_unrealize_button (column);
-      for (list = tree_view->priv->columns; list; list = list->next)
-       {
-         PsppSheetViewColumn *tmp_column;
-
-         tmp_column = PSPP_SHEET_VIEW_COLUMN (list->data);
-         if (tmp_column->visible)
-           _pspp_sheet_view_column_cell_set_dirty (tmp_column);
-       }
 
       if (tree_view->priv->n_columns == 0 &&
          pspp_sheet_view_get_headers_visible (tree_view) && 
@@ -8991,12 +8983,6 @@ pspp_sheet_view_insert_column (PsppSheetView       
*tree_view,
 
       _pspp_sheet_view_column_realize_button (column);
 
-      for (list = tree_view->priv->columns; list; list = list->next)
-       {
-         column = PSPP_SHEET_VIEW_COLUMN (list->data);
-         if (column->visible)
-           _pspp_sheet_view_column_cell_set_dirty (column);
-       }
       gtk_widget_queue_resize (GTK_WIDGET (tree_view));
     }
 
-- 
2.1.4




-- 
Avoid eavesdropping.  Send strong encryted email.
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]