From: Johannes Schindelin Date: Sun, 18 Jan 2009 01:12:02 GMT Subject: Re: [PATCH] interpret_nth_last_branch(): avoid traversing the reflogs twice Message-ID: In-Reply-To: <7vmydp5tqj.fsf@gitster.siamese.dyndns.org> Hi, On Sat, 17 Jan 2009, Junio C Hamano wrote: > Johannes Schindelin writes: > > > That is correct. But this is such a highly uncritical code path that > > I'd like to keep this simple rather than fast. > > I actually not worried about "fast" at all; it was more about unbounded > memory consumption. Let's just assume that I make a branch switch per minute, continuously, for 90 days (until the reflogs are expired), and let's say that all my branchnames have 20 characters. Conservatively, the memory requirement would be 100 * 2000 * 30 = 3 megabyte. Note: these are the memory requirements after some really unrealistically high activity, and the memory is free()d during parameter parsing. A much more realistical expectation would be to switch branches maybe 20 times a day, which would amount to something like 36 kilobyte. And again, they are free()d before the action really starts. Ciao, Dscho