GNOME Bugzilla – Bug 589121
title change causes long delay before editing is possible
Last modified: 2011-10-03 20:11:13 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)
do you have a patch? 450 notes is a lot. I suspect you had the exact same issues with Tomboy.
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.
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.
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 ***