After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 589121 - title change causes long delay before editing is possible
title change causes long delay before editing is possible
Status: RESOLVED DUPLICATE of bug 660653
Product: gnote
Classification: Applications
Component: main
0.5.x
Other All
: Normal minor
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2009-07-20 12:10 UTC by Terrance Star
Modified: 2011-10-03 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Terrance Star 2009-07-20 12:10:48 UTC
change the underlying algorithm to scale better with number of notes. i have about 450 notes (after switching from tomboy).


Other information:
after browsing the source lightly i came up with the following routines which seems suspect:
on_note_renamed

maybe this line is the culprit:
m_notes.sort(boost::bind(&compare_dates, _1, _2));

anyway: my notes are not too large (max 1K) and not too many (just 1Mb of data)
Comment 1 Hubert Figuiere (:hub) 2009-07-21 06:58:11 UTC
do you have a patch?

450 notes is a lot. I suspect you had the exact same issues with Tomboy.
Comment 2 Terrance Star 2009-07-21 12:15:23 UTC
i don't have a patch, my code exploration was mainly static (didn't even compile), though i did do some experimentation with changing titles.

i have been using Tomboy/gnote for quite some time so 450 is reasonable (can't remember if Tomboy had the problem, but i think it didn't - because i would have noticed it).

i guess one could easily create a note generator (possibly directly to filesystem) which would enable to test this number of notes quickly. it takes more than a second but my computer is slow, a developer with a quick computer might miss this bug.

anyway, i suggest first localizing the delay with dynamic debugging, and then thinking up a solution.
Comment 3 Aurimas Černius 2010-10-06 20:09:01 UTC
I've tried experimenting with this in virtual machine, where everything works sensibly slower, than on main machine. Note rename became sensibly slower when number of notes became larger than about 300.
I've compiled gnote with profiling enabled and it seems, that rebuilding TrieTree is the place, where most of the time is spent. On note rename TrieTree is rebuilt. Adding remove_keyword to it may allow to speedup rename, but I need some more experiments on that, as it's just a hypothesis.

What I can tell more precisely is that the line, mentioned in 1-st comment gives a speedup of only about 4-5%, when removed. And it looks like it can be removed, because sorting of notes occurs for the second when note is saved. Of course, this causes the note list not being updated in search notes window for some time after rename.
Comment 4 Aurimas Černius 2011-10-03 20:11:13 UTC
A new bug (660653) was opened for this issue, but it contains a patch, that makes a big difference.
Bug 660663 has another patch, that should improve performance even further.
Closing this one, the patches from other two are expected to land into Gnote soon.

*** This bug has been marked as a duplicate of bug 660653 ***