From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: "git reflog expire --all" very slow Date: Mon, 30 Mar 2009 22:50:20 -0700 Message-ID: <7vr60e6y1v.fsf@gitster.siamese.dyndns.org> References: <7vk5668g55.fsf@gitster.siamese.dyndns.org> <7vy6um6z9m.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Brandon Casey , Johannes Schindelin , Git Mailing List To: Linus Torvalds X-From: git-owner@vger.kernel.org Tue Mar 31 07:52:10 2009 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1LoWtN-00016N-B7 for gcvg-git-2@gmane.org; Tue, 31 Mar 2009 07:52:09 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755952AbZCaFuc (ORCPT ); Tue, 31 Mar 2009 01:50:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755769AbZCaFuc (ORCPT ); Tue, 31 Mar 2009 01:50:32 -0400 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:37257 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755049AbZCaFuc (ORCPT ); Tue, 31 Mar 2009 01:50:32 -0400 Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 97F96A62BB; Tue, 31 Mar 2009 01:50:28 -0400 (EDT) Received: from pobox.com (unknown [68.225.240.211]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id B6582A62B8; Tue, 31 Mar 2009 01:50:22 -0400 (EDT) In-Reply-To: <7vy6um6z9m.fsf@gitster.siamese.dyndns.org> (Junio C. Hamano's message of "Mon, 30 Mar 2009 22:24:05 -0700") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: D6A62DBE-1DB7-11DE-849F-32B0EBB1AA3C-77302942!a-sasl-fastnet.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Junio C Hamano writes: > Linus Torvalds writes: >> ... >> This if anything makes things just go slower. >> >> Not much, but some. It went from 36.566s to 38.070s. That may be in the >> noise, I've not done any sensitivity analysis. > > I actually think that the cutoff for history traversal is bogus. You may > have a 30-day old reflog entry that pulled in a 45-day old commit, and > giving up the smudging at the expiry cutoff timestamp does not make much > sense. > > I do have a lot of reflog entries kept around, as my main repository has > these: > > [gc] > reflogexpire = '2005-01-01 00:00:00 +0000' > reflogexpireunreachable = '2005-01-01 00:00:00 +0000' > > so let me experiment a bit more. To initially prune a copy of my git repository that was never pruned before, it takes a lot of time with or without the patch to prune from the original 73476 reflog entries. (without patch) 23.46user 0.23system 0:23.70elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+5464outputs (0major+6045minor)pagefaults 0swaps (with patch, but with a bit of fprintf's for counting) 21.99user 0.40system 0:22.56elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+5472outputs (0major+6040minor)pagefaults 0swaps After the initial pruning, with 13780 reflog entries still left (and no further pruning expected), I am seeing these: (without patch) 2.09user 0.22system 0:02.32elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+5464outputs (0major+4956minor)pagefaults 0swaps (with patch, but again with a bit of fprintf's for counting) 0.76user 0.25system 0:01.05elapsed 96%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+5464outputs (0major+4918minor)pagefaults 0swaps I might be better off traversing down all the way and do away with in_merge_bases(), but that might hold true only for something small like git.git and the kernel.