Skip to content

Commit

Permalink
gitk: Limit how often we change the canvas scrolling region
Browse files Browse the repository at this point in the history
For some unknown reason, changing the scrolling region on the canvases
provokes multiple milliseconds worth of computation in the X server,
and this can end up slowing gitk down significantly.  This works around
the problem by limiting the rate at which we update the scrolling region
after the first 100 rows to at most 2 per second.

Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Paul Mackerras committed Jun 23, 2007
1 parent 6fb735a commit a2c2236
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -2616,15 +2616,21 @@ proc layoutmore {tmax allread} {
proc showstuff {canshow last} {
global numcommits commitrow pending_select selectedline curview
global lookingforhead mainheadid displayorder nullid selectfirst
global lastscrollset

if {$numcommits == 0} {
global phase
set phase "incrdraw"
allcanvs delete all
}
set r0 $numcommits
set prev $numcommits
set numcommits $canshow
setcanvscroll
set t [clock clicks -milliseconds]
if {$prev < 100 || $last || $t - $lastscrollset > 500} {
set lastscrollset $t
setcanvscroll
}
set rows [visiblerows]
set r1 [lindex $rows 1]
if {$r1 >= $canshow} {
Expand Down

0 comments on commit a2c2236

Please sign in to comment.