From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout.web.de (mout.web.de [212.227.15.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 106F0219EA for ; Fri, 26 Jul 2024 09:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.227.15.3 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721987755; cv=none; b=iyZrjRDQta2hRr+RT55kvHyGxk8v4M0uVrLriFD57daCVsjkKmLRSHlrQuKZoeWiW8AozcLk6c8QM0ltAlIlRMWjlfktDbhPQ5j5/kf7h+5BQ6i/HCPV/Y+OEmeJzEUrX+AyfY74SelPhSocbCa89vMxzYPzYYlZ807r51PuHuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721987755; c=relaxed/simple; bh=laSctBR2qTzyI7/i6yrgkbF6BH7KNgLg3UXq8W2Qazc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S/Kgu+useYhrEEmrPCYjnhVdGOn180jju5YJjK3LTPmkCwkuZdVcQhHux8AvtwJ6APfkYuOiOtcQtHE54vnpSd8mY6vjJ0wCLh0+Zd96KijBFqs0EomDWVm4Igy+o1MnMOOFniCmhTKMxAqKTire1Pbfa0YQ+kIcNKMobO5XYXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de; spf=pass smtp.mailfrom=web.de; dkim=pass (2048-bit key) header.d=web.de header.i=tboegi@web.de header.b=o+biIxcC; arc=none smtp.client-ip=212.227.15.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=tboegi@web.de header.b="o+biIxcC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1721987737; x=1722592537; i=tboegi@web.de; bh=N1BWaPxyCJm/09Kr1llejvQclVlsvO9pC5hlhHfWtq8=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To:Content-Transfer-Encoding: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=o+biIxcCPkBj2qwTcT0N80LeQm1oM1W008QtZoQTLw+xVmQAHCAcgMxlx6EqF8K2 Fpd90klFgs8Z1I5GVhpqkTjI5t6nUhmSpiunisExdOyAb0U9mUPSlFgnxwGIlRm8m 2zPsOJyFSjoFpLxh0sVtJcGOVTOy6gJacFzRn4KS4usxsss23gp2Du3g8mdqTLt9M CfcPvV1uYglC5HrxFmK0yb7OWhUB4M181nyrpOi4hMK189wkfJ4+P7ias4Guls/yp IoL33zpVLDw13tadd21wVFK7JJ+DnXV/vqNsw/vPUprCL6EMJcmQL4sKEdOkzoc33 Qg6TOUxNur2DETSO0w== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from localhost ([81.231.143.213]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MLzin-1soXZh3iJF-00M2mG; Fri, 26 Jul 2024 11:55:36 +0200 Date: Fri, 26 Jul 2024 11:55:35 +0200 From: Torsten =?iso-8859-1?Q?B=F6gershausen?= To: Haritha via GitGitGadget Cc: git@vger.kernel.org, Jeff King , Haritha Subject: Re: [PATCH v3] Fix to avoid high memory footprint Message-ID: <20240726095535.GA32544@tb-raspi4> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: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0Xn15Wbdw6MB2IiqGPZdF4P eO7XRYBTGapGhFJkUO7ivviQ== Content-Transfer-Encoding: quoted-printable On Fri, Jul 26, 2024 at 06:27:14AM +0000, Haritha via GitGitGadget wrote: > From: D Harithamma > > When Git adds a file requiring encoding conversion and tracing of encodi= ng > conversion is not requested via the GIT_TRACE_WORKING_TREE_ENCODING > environment variable, the `trace_encoding()` function still allocates & > prepares "human readable" copies of the file contents before and after > conversion to show in the trace. This results in a high memory footprint > and increased runtime without providing any user-visible benefit. > > This fix introduces an early exit from the `trace_encoding()` function > when tracing is not requested, preventing unnecessary memory allocation > and processing. > > Signed-off-by: Harithamma D > --- > Fix to avoid high memory footprint > This head line > Fix to avoid high memory footprint does not tell to much when and how it happens. The word "fix" is not realy needed (in this project). Something like "convert: avoid high memory footprint" will tell the reader, that only the convert functionality is affected by this patch. Thinking about it, another suggestion may be: convert: Reduce memory allocation when trace_encoding() is not used If someone browses through the whole history of Git, this is easier to follow. The exact wording may be improved, important would be to have "convert:" as the first keyword, and then "memory allocation" and "trace_encoding()" give hints, what this is all about in one line. And the rest looks good.