Re: [PATCH] interpret_nth_last_branch(): avoid traversing the reflogs twice
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jan 18, 2009, 01:12 UTC
- Message-ID
- <alpine.DEB.1.00.0901180201070.3586@pacific.mpi-cbg.de>
- In-Reply-To
- <7vmydp5tqj.fsf@gitster.siamese.dyndns.org>
Hi,
On Sat, 17 Jan 2009, Junio C Hamano wrote:
Show 7 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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