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 660663 - Optimize note creation, renaming and deletion
Optimize note creation, renaming and deletion
Status: RESOLVED FIXED
Product: gnote
Classification: Applications
Component: main
git master
Other Linux
: Normal normal
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2011-10-01 23:34 UTC by Debarshi Ray
Modified: 2011-10-11 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
placeholder.note: needed to create set of random notes (739 bytes, application/octet-stream)
2011-10-01 23:34 UTC, Debarshi Ray
  Details
Optimize note creation, renaming and deletion (5.64 KB, patch)
2011-10-01 23:37 UTC, Debarshi Ray
none Details | Review

Description Debarshi Ray 2011-10-01 23:34:12 UTC
Created attachment 197988 [details]
placeholder.note: needed to create set of random notes

With a large number of notes, Gnote becomes very slow at creating, renaming and deleting notes.

First, there is no need to throw away the whole trie and re-create it from scratch when a new note is being created. The title of the new note can be added to the existing trie.

Secondly there is no need to throw away and re-create the Gtk::ListStore within the recent changes window from scratch when a note has been created, renamed or deleted. Instead, the existing model can be edited.

How to reproduce:

1) Start with an empty ~/.local/share/gnote directory.
2) Use the following shell script and the attached placeholder.note file to create 3000 notes.
  num=0
  until [ $num -gt 2999 ]; do
    title=$(pwgen -N 1 24)
    sed -e 's/NOTE_NUMBER/'"${title}"'/g' placeholder.note >$num.note
    num=$((num+1))
  done
3) Compile Gnote from Git and run it (as: $ /opt/bin/gnote), so that the recent changes window (titled "Search All Notes") opens up.
4) Create a note. There is a significant delay before the new note shows up.
5) Change the title of the note and hit enter at the end of the title line. Signicant delay before the cursor moves to the next line.
6) Delete the note. Again, a similar delay.
Comment 1 Debarshi Ray 2011-10-01 23:37:54 UTC
Created attachment 197989 [details] [review]
Optimize note creation, renaming and deletion
Comment 2 Debarshi Ray 2011-10-01 23:38:40 UTC
The same issues exist in Tomboy too and they should be notified.
Comment 3 Dan Williams 2011-10-04 16:40:58 UTC
Running with this patch for a few days and it's a lot faster with my ~1200 notes.  Haven't noted any regressions though I don't typically bang on gnote a lot, just note creation, renaming, and searching.
Comment 4 Aurimas Černius 2011-10-04 18:47:00 UTC
I see, that Debarshi pushed this into git. Closing the ticket.
Will be in 0.8.1.
Comment 5 Sandy Armstrong 2011-10-11 20:33:53 UTC
Just filed a Tomboy equivalent at bug #661491.  Thanks guys!