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 726871 - treeview: Lower the duration of validation iterations
treeview: Lower the duration of validation iterations
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
unspecified
Other All
: Normal normal
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on:
Blocks:
 
 
Reported: 2014-03-22 12:02 UTC by Bastien Nocera
Modified: 2014-03-28 08:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
treeview: Lower the duration of validation iterations (1.48 KB, patch)
2014-03-22 12:02 UTC, Bastien Nocera
none Details | Review
treeview: Lower the duration of validation iterations (1.54 KB, patch)
2014-03-22 12:06 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2014-03-22 12:02:30 UTC
.
Comment 1 Bastien Nocera 2014-03-22 12:02:34 UTC
Created attachment 272623 [details] [review]
treeview: Lower the duration of validation iterations

GTK_TREE_VIEW_TIME_MS_PER_IDLE is currently 30 milliseconds, meaning
that validate_rows will validate rows. This means that it's likely
to block redrawing via the clock frame update mechanism, as that tops
at 16.66 milliseconds per frame.

Stop validating rows if we've spent more than 3/5 of our alloted budget
for inter-frame processing, so as to avoid blocking.

In the future, we would probably want to calculate how long we would
have left until the next frame, especially if higher priority idles
and timeouts have already consumed a portion of that alloted time.
Comment 2 Bastien Nocera 2014-03-22 12:06:22 UTC
Created attachment 272624 [details] [review]
treeview: Lower the duration of validation iterations

GTK_TREE_VIEW_TIME_MS_PER_IDLE is currently 30 milliseconds, meaning
that validate_rows will validate rows up until all the validations have
taken over 30 msecs. So it's likely to block redrawing via the clock
frame update mechanism, as that tops at 16.66 milliseconds per frame
(1/60th of a second).

Stop validating rows if we've spent more than 3/5 of our allotted budget
for inter-frame processing, so as to avoid blocking.

In the future, we would probably want to calculate how long we would
have left until the next frame, especially if higher priority idles
and timeouts have already consumed a portion of that allotted time.
Comment 3 Matthias Clasen 2014-03-22 19:41:17 UTC
interesting idea. Should probably do the same in the text view
Comment 4 Bastien Nocera 2014-03-28 00:52:25 UTC
(In reply to comment #3)
> interesting idea. Should probably do the same in the text view

I can't find the equivalent in GtkTextView.

Owen, is this good enough to commit now?
Comment 5 Owen Taylor 2014-03-28 01:49:16 UTC
Seems good enough to me. The alternative would be to just shorten the time up a lot further (to 5ms or 2ms or whatever) and let it run until GdkFrameClock kicks it out and starts rendering the frame.

GtkTextView is just validating 2000 pixels an idle cycle - I don't have an exact guess about how long that takes. (If it can validate 1,000,000 characters per second and there are 50 characters on a line and 20 pixels per line, then that would be 5ms.)
Comment 6 Bastien Nocera 2014-03-28 08:33:57 UTC
Attachment 272624 [details] pushed as d6f9247 - treeview: Lower the duration of validation iterations
Comment 7 Bastien Nocera 2014-03-28 08:34:50 UTC
Pushed. We'll see if GtkTextView shows up in profiling in a separate bug.

Thanks for the reviews!