Re: [PATCH 0/3] gitk: memory consumption improvements

2 messages, 2 authors, 2016-11-09 · open the first message on its own page

Re: [PATCH 0/3] gitk: memory consumption improvements

From: Junio C Hamano <hidden>
Date: 2016-11-08 21:37:48

Markus Hitter [off-list ref] writes:
List, Paul,

after searching for a while on why Gitk sometimes consumes
exorbitant amounts of memory I found a pair of minor issues and
also a big one: the text widget comes with an unlimited undo
manager, which is turned on be default. Considering that each line
is inserted seperately, this piles up a huuuge undo stack ... for
a read-only text widget. Simply turning off this undo manager
saves about 95% of memory when viewing large commits (with tens of
thousands of diff lines).
You made me laugh crazy hard while in a waiting room in a clinic
yesterday with the cover letter; people around gave me a strange
look but I couldn't help.

This is a single liner with the largest gain in the history of this
project.  Very well spotted.

Are all semi-modern Tcl/Tk in service have this -undo thing so that
we can pass unconditionally to the text widget like the patch does?

If we had to do this conditionally, that robs the fun of "just
adding 8 bytes to the source to reduce 1+GB memory consumption", but
even if we had to go conditional, this is a great find.

Well done.

Re: [PATCH 0/3] gitk: memory consumption improvements

From: Markus Hitter <hidden>
Date: 2016-11-09 12:39:43

Am 08.11.2016 um 22:37 schrieb Junio C Hamano:
Are all semi-modern Tcl/Tk in service have this -undo thing so that
we can pass unconditionally to the text widget like the patch does?
Good point. As far as my research goes, this flag was introduced in Nov. 2001:

http://core.tcl.tk/tk/info/5265df93d207cec0


To defend Gitk developers, the Tk guys apparently change their mind on the default value from time to time. Official documentation says nothing about a default, the proposal from 2001 talks about -undo 0 as default and there are recent commits changing this default:

http://core.tcl.tk/tk/info/549d2f56757408f3


Markus

-- 
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. (FH) Markus Hitter
http://www.jump-ing.de/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help