Footnote is extremely slow

Bug #907018 reported by Andrea Basso
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Footnote
Fix Committed
Critical
Jaap Broekhuizen

Bug Description

Footnote now takes about 10 seconds to start on a Core 2 Duo. The window appears immediately, but it takes a lot to show the "inside".
Even adding a new note to a notebook with ~30 notes takes about the same time.
Switching notebook takes 4/5 secs.
It can't be used with these delays.

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

"Now" meaning that wasn't like this some revisions before? If so do you remember the revision which changed that?

Revision history for this message
Andrea Basso (voluntatefaber) wrote :

With revision 50 it was fast and efficient, then I haven't tested all revisions till 60, as soon as I can I'm going to test all revisions between 51 and 59 and report here when this started.

I haven't checked yet because I thought it was a common problem, is it only me who's experiencing this problem?

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

For me it's no problem, everything runs as fast as possible.

Revision history for this message
Andrea Basso (voluntatefaber) wrote :

Ok, after some tests I got:

At revision 51 it was still fast as it's always been.
At revision 52 startup remained fast, but switching notebook become very slow.
At revision 53 even startup become very slow.

Revision history for this message
Tom Beckmann (tombeckmann) wrote :

Which Desktopmanager do you use? Do you have hardware acceleration?

Revision history for this message
Andrea Basso (voluntatefaber) wrote :

I use unity 3D under Ubuntu, so yes, I have hardware acceleration.

Revision history for this message
Andrea Basso (voluntatefaber) wrote :

Forgot to say, Ubuntu 11.10

Revision history for this message
Jaap Broekhuizen (jaapz-b) wrote :

I have a i5 quad core using SandyBridge graphics, and i have indeed the same problem when adding 20+ notes. I guess it is because Gtk just doesnt like it when you show() and hide() that number of VBoxes every time you switch. I'm assigning myself to this as i am the one who caused it, i'm going to think of a nice solution!

Changed in footnote:
assignee: nobody → Jaap Broekhuizen (jaapz-b)
status: New → Confirmed
importance: Undecided → Critical
Revision history for this message
Andrea Basso (voluntatefaber) wrote :

After some test I found out these are the two parts that takes a lot at start-up. Both are located in NoteView.vala

First part:

foreach (Gtk.Widget w in get_children ()){
    print ("\nA");
    if (w.visible) //check if we need to show/hide it
         w.hide();
}

Second part:

if (app.selected.category != null)
 foreach (Note n in app.selected.category.notes) {
  if (filter == "" ||
      filter.down () in n.title.down () ||
      filter.down () in n.content.down () ||
      n.tag_area.has_tag(filter)) {
   if (!n.visible)
    n.show_all ();
    showed++;
  }else{
   if (n.visible)
    n.hide ();
  }
 }

Revision history for this message
Jaap Broekhuizen (jaapz-b) wrote :

Yes, like i said, the hiding and showing of widgets is very slow. You can expect a fix somewhere at the end of this week!

Revision history for this message
Andrea Basso (voluntatefaber) wrote :

Thanks, I'm glad to hear that, right now I'm stuck to rev 49.

Revision history for this message
Jaap Broekhuizen (jaapz-b) wrote :

I pushed a fix that made rendering notes significantly faster on my machine, could you please test it (rev 63)? Rendering is still not very snappy, and i guess that is because we are using Granite.Drawing.BufferSurface, which is, quoting the documentation, "designed for usage with large, rarely updated draw operations", and notes are neither large nor rarely updated...

Changed in footnote:
status: Confirmed → In Progress
Revision history for this message
Tom Beckmann (tombeckmann) wrote :

I removed Granite.BufferSurface in rev65, for me it's faster.

Revision history for this message
Andrea Basso (voluntatefaber) wrote :

To me now it's fast enough to be usable and even better than before.

Revision history for this message
Jaap Broekhuizen (jaapz-b) wrote :

Faster here too, though the gradient around the note is not very nice, but i guess that is not relevant here. Marking as fixed!

Changed in footnote:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.