From: David Turner Subject: Re: [PATCH v3 2/4] path: optimize common dir checking Date: Sun, 16 Aug 2015 05:04:22 +0000 (UTC) Message-ID: References: <1439416645-19173-1-git-send-email-dturner@twopensource.com> <1439416645-19173-2-git-send-email-dturner@twopensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Sun Aug 16 07:15:40 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZQqIF-0003XJ-QS for gcvg-git-2@plane.gmane.org; Sun, 16 Aug 2015 07:15:40 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750719AbbHPFPK (ORCPT ); Sun, 16 Aug 2015 01:15:10 -0400 Received: from plane.gmane.org ([80.91.229.3]:50729 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750705AbbHPFPJ (ORCPT ); Sun, 16 Aug 2015 01:15:09 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZQqHg-000319-Mw for git@vger.kernel.org; Sun, 16 Aug 2015 07:15:05 +0200 Received: from 207-38-164-98.c3-0.43d-ubr2.qens-43d.ny.cable.rcn.com ([207.38.164.98]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2015 07:15:04 +0200 Received: from dturner by 207-38-164-98.c3-0.43d-ubr2.qens-43d.ny.cable.rcn.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Aug 2015 07:15:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 207.38.164.98 (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/43.0.2357.81 Chrome/43.0.2357.81 Safari/537.36) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Duy Nguyen writes: > On Thu, Aug 13, 2015 at 4:57 AM, David Turner wrote: > > Instead of a linear search over common_list to check whether > > a path is common, use a trie. The trie search operates on > > path prefixes, and handles excludes. > > Just be careful that the given key from git_path is not normalized. I > think you assume it is in the code, but I haven't read carefully. We > could of course optimize for the good case: assume normalized and > search, then fall back to explicit normalizing and search again. What does it mean for a key to be normalized? Do you mean normalized in terms of upper/lowercase on case-insensitive filesystems? If so, I think the assumption here is that this will be called with paths generated by git, which will always use the lowercase path.