summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Hitter <mah@jump-ing.de>2016-11-06 20:38:03 +0100
committerPaul Mackerras <paulus@ozlabs.org>2016-12-12 20:39:37 +1100
commit106a6d9d85ead187f8b1be64b7a8dbf19a128743 (patch)
tree1a5f403fd4bc265a47d6269e2ab32c2e0c0d1c90
parent75517bf2c109a9a5678bf349b4fe48fdefee3e5a (diff)
downloadgit-106a6d9d85ead187f8b1be64b7a8dbf19a128743.tar.gz
gitk: Turn off undo manager in the text widget
The diff text widget is read-only, so there's zero point in building an undo stack. This change reduces memory consumption of this widget by about 95%. Memory usage of the whole program for viewing a reference commit before; 579'692'744 bytes, after: 32'724'446 bytes. Test procedure: - Choose a largish commit and check it out. In this case one with 90'802 lines, 5'006'902 bytes. - Have a Tcl version with memory debugging enabled. This is, build one with --enable-symbols=mem passed to configure. - Instrument Gitk to regularly show a memory dump. E.g. by adding these code lines at the very bottom: proc memDump {} { catch { set output [memory info] puts $output } after 3000 memDump } memDump - Start Gitk, it'll load this largish commit into the diff text field automatically (because it's the current commit). - Wait until memory consumption levels out and note the numbers. Note that the numbers reported by [memory info] are much smaller than the ones reported in 'top' (1.75 GB vs. 105 MB in this case), likely due to all the instrumentation coming with the debug version of Tcl. Signed-off-by: Markus Hitter <mah@jump-ing.de> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-rwxr-xr-xgitk2
1 files changed, 1 insertions, 1 deletions
diff --git a/gitk b/gitk
index 4d531b335a..08ff7ceb2b 100755
--- a/gitk
+++ b/gitk
@@ -2406,7 +2406,7 @@ proc makewindow {} {
set ctext .bleft.bottom.ctext
text $ctext -background $bgcolor -foreground $fgcolor \
- -state disabled -font textfont \
+ -state disabled -undo 0 -font textfont \
-yscrollcommand scrolltext -wrap none \
-xscrollcommand ".bleft.bottom.sbhorizontal set"
if {$have_tk85} {