Bug 242884 - very slow when typing in editable fields at bottom
Summary: very slow when typing in editable fields at bottom
Status: RESOLVED FIXED
Alias: None
Product: keditbookmarks
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
: 260729 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-26 16:48 UTC by Jonathan Marten
Modified: 2011-02-03 00:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Marten 2010-06-26 16:48:52 UTC
Version:           unspecified (using Devel) 
OS:                Linux

A bookmark can be updated by editing the "Name", "Location" or "Comment" fields below the tree view.  However, typing here seems to respond very slowly with a lag of at least a second between pressing a key and the text updating (this on a 3-core 2.5GHz CPU).  Holding down a key so that it auto-repeats takes all 3 cores to 100% CPU.

While this is happening, debug messages such as

keditbookmarks(22947)/kio (bookmarks) KBookmarkManager::saveAs: KBookmarkManager::save  "/usr/home/jjm/.kde4/share/apps/konqueror/bookmarks.xml"             
konqueror(21786)/kio (bookmarks) KBookmarkMenu::slotBookmarksChanged: KBookmarkMenu::slotBookmarksChanged(  "/15"
krunner(10822) KBookmarkManager::notifyChanged: KBookmarkManager::notifyChanged (  "/15" )                                                                         
keditbookmarks(22947) KBookmarkManager::notifyChanged: KBookmarkManager::notifyChanged (  "/15" )                           

are continuously printed on stderr.  It seems that the bookmarks file is being saved, and all users of it notified, on every key press.  This includes every Konqueror window.

This does not happen if the bookmark name or URL is changed using "Rename" or "Change Location" in the tree view - the save/update only happens when Return is pressed.

This is not the same slowness problem frequently reported for adding/deleting bookmarks when the user has lots of them - none of them mention these editable fields.  I have about 900 bookmarks.


Reproducible: Always




Suggestion to fix: When these fields are being edited, only save/update the bookmarks file on an idle timer (e.g. after 1 second), on the Return/Enter key, or if focus moves away.
Comment 1 David Faure 2011-02-02 23:09:45 UTC
*** Bug 260729 has been marked as a duplicate of this bug. ***
Comment 2 David Faure 2011-02-03 00:05:38 UTC
Git commit 1a509e8dea82f026a317508c4fa084c29f337bf9 by David Faure.
Committed on 02/02/11 at 23:47.
Pushed by dfaure into branch 'master'.

Fix change compression when editing fields: showBookmark was committing changes

and notifyManagers() was leading to a third save and a second full-tree-reload.
Removed these calls, since command::redo does it already.

Also fixed change compression messing up the "old value", so undo didn't restore
the orig value.

FIXED-IN: 4.6.1
BUG: 242884

M  +10   -16   keditbookmarks/bookmarkinfowidget.cpp     
M  +10   -5    keditbookmarks/kbookmarkmodel/commands.cpp     

http://commits.kde.org/kde-baseapps/1a509e8dea82f026a317508c4fa084c29f337bf9
Comment 3 David Faure 2011-02-03 00:05:38 UTC
Git commit 4a9c92b29fb17db2587efb1c485068f860b3896d by David Faure.
Committed on 02/02/11 at 23:44.
Pushed by dfaure into branch 'master'.

Only connect to the changed() signal, otherwise the slot is called twice

and the second time reloads the whole tree
(bookmarksChanged is the DBUS signal, so changed gets emitted afterwards)
CCBUG: 242884

M  +8    -5    keditbookmarks/kbookmarkmodel/model.cpp     

http://commits.kde.org/kde-baseapps/4a9c92b29fb17db2587efb1c485068f860b3896d
Comment 4 David Faure 2011-02-03 00:31:55 UTC
Git commit c2c3a87985b7ab5b13ba9b7833b85410e03f6c4c by David Faure.
Committed on 02/02/11 at 23:47.
Pushed by dfaure into branch 'KDE/4.6'.

Fix change compression when editing fields: showBookmark was committing changes

and notifyManagers() was leading to a third save and a second full-tree-reload.
Removed these calls, since command::redo does it already.

Also fixed change compression messing up the "old value", so undo didn't restore
the orig value.

FIXED-IN: 4.6.1
BUG: 242884
(cherry picked from commit 1a509e8dea82f026a317508c4fa084c29f337bf9)

M  +10   -16   keditbookmarks/bookmarkinfowidget.cpp     
M  +10   -5    keditbookmarks/kbookmarkmodel/commands.cpp     

http://commits.kde.org/kde-baseapps/c2c3a87985b7ab5b13ba9b7833b85410e03f6c4c
Comment 5 David Faure 2011-02-03 00:31:55 UTC
Git commit 9379223f964c3d6f69769e4685bb3ac6fdb1dd1a by David Faure.
Committed on 02/02/11 at 23:44.
Pushed by dfaure into branch 'KDE/4.6'.

Only connect to the changed() signal, otherwise the slot is called twice

and the second time reloads the whole tree
(bookmarksChanged is the DBUS signal, so changed gets emitted afterwards)
CCBUG: 242884
(cherry picked from commit 4a9c92b29fb17db2587efb1c485068f860b3896d)

M  +8    -5    keditbookmarks/kbookmarkmodel/model.cpp     

http://commits.kde.org/kde-baseapps/9379223f964c3d6f69769e4685bb3ac6fdb1dd1a