GNOME Bugzilla – Bug 726871
treeview: Lower the duration of validation iterations
Last modified: 2014-03-28 08:34:50 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.
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.
interesting idea. Should probably do the same in the text view
(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?
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.)
Attachment 272624 [details] pushed as d6f9247 - treeview: Lower the duration of validation iterations
Pushed. We'll see if GtkTextView shows up in profiling in a separate bug. Thanks for the reviews!