From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 0C6472018F for ; Thu, 14 Jul 2016 02:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751188AbcGNCJo (ORCPT ); Wed, 13 Jul 2016 22:09:44 -0400 Received: from mout.web.de ([212.227.17.11]:55505 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751141AbcGNCJl (ORCPT ); Wed, 13 Jul 2016 22:09:41 -0400 Received: from [192.168.0.128] ([205.189.2.14]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0Le4Tw-1b2QxK1szc-00ptTY; Thu, 14 Jul 2016 04:09:31 +0200 Subject: Re: What's cooking in git.git (Jun 2016, #05; Thu, 16) To: Joey Hess References: <18617acb-bcdb-607d-007e-552dabd352cb@web.de> <20160622210958.GA24618@kitenet.net> <1f76a4d3-68b1-db33-5c7b-dc5ab104a3ef@web.de> <20160712222054.GA10128@kitenet.net> Cc: Junio C Hamano , git@vger.kernel.org From: =?UTF-8?Q?Torsten_B=c3=b6gershausen?= Message-ID: Date: Thu, 14 Jul 2016 04:09:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Icedove/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160712222054.GA10128@kitenet.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8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uD8PxINlULEKLLo+6K7SpvVY Fzx0bR5 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 07/13/2016 12:20 AM, Joey Hess wrote: > Torsten Bögershausen wrote re jh/clean-smudge-annex: >> The thing is that we need to check the file system to find .gitatttibutes, >> even if we just did it 1 nanosecond ago. >> >> So the .gitattributes is done 3 times: >> -1 would_convert_to_git_filter_fd( >> -2 assert(would_convert_to_git_filter_fd(path)); >> -3 convert.c/convert_to_git_filter_fd() >> >> The only situation where this could be useful is when the .gitattributes >> change between -1 and -2, >> but then they would have changed between -1 and -3, and convert.c >> will die(). >> >> Does it make sense to remove -2 ? > > There's less redundant work going on than at first seems, because > .gitattribute files are only read once and cached. Verified by strace. > OK, I think I missed that work (not enough time for Git at the moment) Junio, please help me out, do we have a cache here now? I tried to figure out that following your attr branch, but failed. > So, the redundant work is only in the processing that convert_attrs() does > of the cached .gitattributes. > > Notice that there was a similar redundant triple call to convert_attrs() > before my patch set: > > 1. index_fd checks would_convert_to_git_filter_fd > 2. index_stream_convert_blob does assert(would_convert_to_git_filter_fd(path)) > (Again redundantly since 1. is its only caller and has already > checked.) > 3. in convert_to_git_filter_fd > > If convert_attrs() is somehow expensive, it might be worth passing a > struct conv_attrs * into the functions that currently call > convert_attrs(). But it does not look expensive to me. I have that on the list, but seems to be uneccesary now. > > I think it would be safe enough to remove both asserts, at least as the > code is structured now. > OK.