From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22739 invoked from network); 28 Mar 2021 05:06:51 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Mar 2021 05:06:51 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1616908011; b=qAtlJ2pTbhMNbyCOLYqVytMy1B87LnWCVahhyuBdi0ByTYK3owB1310W3hL8tOr6KrFXO3T4xV vzKG7lenixEN0EDrkpf0eQf4hIdwg3MXMgU8xWxwBqNOgweByoXItzyEiHoMnhWYVcgUkXVRSp BC1gXEzZWAxoTatfFYA/xzKpDA4CMwCYR6dSAF03hY3v5KJHjSdOBXr6zpXiZ5OKS1UNAjciV9 PCRBqEo7IkwcFEQo55DC5nCvs5ciHwgkpM3+/1jRsB+CEsOnYJ73y20FHRo7016/JgpoXmXk5s rt2tkDXM9TZuq3bJQeIpGYAejA8/VpF9s0EUuluID9m8aQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-qt1-f176.google.com) smtp.remote-ip=209.85.160.176; dkim=pass header.d=dana-is.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=dana.is; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1616908011; bh=0BRCSTcIv4okF4q/7GsK0U/UjFb1OSAQxG7/GAAjYRI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:To:References:Message-ID:Content-Transfer-Encoding:Cc:Date: In-Reply-To:From:Subject:MIME-Version:Content-Type:DKIM-Signature: DKIM-Signature; b=rYopY8xyP1jmSwxIBBXVkbTe909R6CUF8l1cuYFvQEgLNGIKEqgn8ewQoYIFRNaNCF5oSVM45S 7tAG+Py22bwsVwlTsfpNJo9ZtH2zZBwutkotlKWML8ajqekPd0QVN+AD/mX1sa03jAOaTt6swo OiVQz80Np1dqLpy/dgDaYWcrdqKeY6HJptX+40aEXOnYKoR9wTpB0Ip4d1hs10YMcsPKMx3Jv1 dK9WWswdAczEjarMRbmchd9BalrIPkvqNu75FHYRsPoIpTLnwGwNGsDbBvTIHV6DB3T/Pectkk lqbVUVH7D4EqHoXVDhv7SbDCeC88XO/5Et83IfXuw0txlw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:To:References:Message-Id: Content-Transfer-Encoding:Cc:Date:In-Reply-To:From:Subject:Mime-Version: Content-Type:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Dd0oqe7dSy2o+bBv4Mxx7k/4eS+JcaXbHV7Zf0KDgDw=; b=R0+Y98xT8R/b3FiEOgjUkOYxFV LRhqoxfG6tWrVCP6mfP/3PlPv7/0eJemeyD1AIhlnpgW28RYDeF5LCKElacKl0IqwxLlrfXaQCFeP FER6hcSEi7wq9wClrWIN68aRI1oRlziReZjR5kANNfwuw/yBik/69nz7v09EZ//J1gY0+oSVyfEb5 iPX23mhJI7rAgDAo31NYsUaza4lzk0Jc6SY8BTFzJ3ZRinXjuEUOzT8M+tt00mHhjbO8iAeAdwB2N Fyu8pfXSax8HJnoSFeGgRgdr7q1Fnq/ncV7lnjAL9VPYJsFf1bBX19h5Asz6l+7bo2x/A6aMAk0Fx 9/MQtoAQ==; Received: from authenticated user by zero.zsh.org with local id 1lQNdP-000LPV-Jx; Sun, 28 Mar 2021 05:06:47 +0000 Authentication-Results: zsh.org; iprev=pass (mail-qt1-f176.google.com) smtp.remote-ip=209.85.160.176; dkim=pass header.d=dana-is.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=dana.is; arc=none Received: from mail-qt1-f176.google.com ([209.85.160.176]:35669) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lQNd3-000LGK-3j; Sun, 28 Mar 2021 05:06:26 +0000 Received: by mail-qt1-f176.google.com with SMTP id a11so7205041qto.2 for ; Sat, 27 Mar 2021 22:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Dd0oqe7dSy2o+bBv4Mxx7k/4eS+JcaXbHV7Zf0KDgDw=; b=ssYx6c6+WTdgXMO20DOnWneAjFJ6u02n8uq+NPzmN6KCZW0VjZEEY4PVxrP8E7CbsJ RCsnQ6Itff2HpNxPAjSjNU7S1q9u3AWeuQDUVE3p8zW6YUPIzkuoxUAFMOEqt+8tjGT/ jwLScWA1t5y6YCNSIa3is4G6axEqfNyyaKfqZDdq8kGfglyp1VDNLCbwSsK4TAgB6w8a U+lYNrCMSQiOeJW7wY6wVayHbIW2yRynqQXUmuXpa3L/ESywgjR/ehcKeSUgtrbYm4nl SPajfld8TPOxZ12QWsZTVIQVXNxeBunAoOzhd7TnPsyaix+qN5E1SN4EHbRLooqGljSR 9FIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Dd0oqe7dSy2o+bBv4Mxx7k/4eS+JcaXbHV7Zf0KDgDw=; b=Q7cXf3el8s+LPKMBaasjSW1T5u6bnekAd0zD//VdP64Q37CAxh144guYZp/EhCfOPR pevmPJgSD9Ed+ftmIgtSBfhi2qOYeQ572ibfF1HQ04ny7IpymgCWzcJxZDEP6vQTn5Uw 5aEozHdndFarUTubsPO2V8pbaemsKvHkfmzd//I/E+SMAYEIPESXHHOLVqtlYQcO13z5 IgcDjxjDDjnq7eyzaAJZYmXTZRnd0+aSPyvJcUK0aWqFK+PmUQljf7Lnl/TbJjt2OpaX pRBKCXfZkxYMoeU2akFCdcXM11A01pAUlGn/XrQHtrr58Vml8rWOYbO3pp/vEzDIfCEI KbEA== X-Gm-Message-State: AOAM532N3qs3dsvL16HFzdxlhBIL6gqMKKGH4AP6lzCY/JmsH25FFD23 WqEH4yyZTEKSVkdHKmQ/PMPjAg== X-Google-Smtp-Source: ABdhPJwmU1pUNyGXJ/lNyS9Cog3Y0J3vsY2f8ZzgqkwccAjn8DSAJITxsQJjdlWNEx+CWGX7sN98hg== X-Received: by 2002:ac8:e09:: with SMTP id a9mr18114030qti.238.1616907983673; Sat, 27 Mar 2021 22:06:23 -0700 (PDT) Received: from heartswap.lan.dana.is (173-17-84-59.client.mchsi.com. [173.17.84.59]) by smtp.gmail.com with ESMTPSA id n77sm10368789qkn.128.2021.03.27.22.06.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Mar 2021 22:06:23 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [RFC] Case-insensitive path completion in _git From: dana In-Reply-To: <20210327210826.GJ18178@tarpaulin.shahaf.local2> Date: Sun, 28 Mar 2021 00:07:17 -0500 Cc: Zsh hackers list Content-Transfer-Encoding: quoted-printable Message-Id: <1C958552-603A-4716-8D4B-EF1EDA6D304F@dana.is> References: <20210327210826.GJ18178@tarpaulin.shahaf.local2> To: Daniel Shahaf X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Seq: 48282 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On 27 Mar 2021, at 16:08, Daniel Shahaf wrote: > What about the default use-case =E2=80=94 no matchspec and = case-sensitive > matching? The patch transforms a plain string to a list of character > classes, and it's not clear to me what costs that might incur on large > trees. I recently learnt that ls-files actually does support case-insensitive matching using the following syntax: :(icase)/foo/bar/baz Whether there might still be performance issues with it =E2=80=94 i ran = a quick test against the Linux tree and it looks good enough to me, but idk how to = make it conclusive: % hyperfine --warmup=3D3 \ "git ls-files -- ${(q)PWD}/'*Kbuild*'" \ "git ls-files -- ${(q)PWD}/'*[Kk][Bb][Uu][Ii][Ll][Dd]*'" \ "git ls-files -- ':(icase)'${(q)PWD}/'*kbuild*'" Benchmark #1: git ls-files -- /home/dana/linux/'*Kbuild*' Time (mean =C2=B1 =CF=83): 27.4 ms =C2=B1 0.9 ms [User: = 18.5 ms, System: 8.8 ms] Range (min =E2=80=A6 max): 26.0 ms =E2=80=A6 31.9 ms 102 runs Benchmark #2: git ls-files -- = /home/dana/linux/'*[Kk][Bb][Uu][Ii][Ll][Dd]*' Time (mean =C2=B1 =CF=83): 71.2 ms =C2=B1 1.0 ms [User: = 62.9 ms, System: 8.2 ms] Range (min =E2=80=A6 max): 70.1 ms =E2=80=A6 76.0 ms 41 runs Benchmark #3: git ls-files -- ':(icase)'/home/dana/linux/'*kbuild*' Time (mean =C2=B1 =CF=83): 32.2 ms =C2=B1 0.6 ms [User: = 23.1 ms, System: 9.1 ms] Range (min =E2=80=A6 max): 30.7 ms =E2=80=A6 33.9 ms 90 runs Summary 'git ls-files -- /home/dana/linux/'*Kbuild*'' ran 1.18 =C2=B1 0.04 times faster than 'git ls-files -- = ':(icase)'/home/dana/linux/'*kbuild*'' 2.60 =C2=B1 0.09 times faster than 'git ls-files -- = /home/dana/linux/'*[Kk][Bb][Uu][Ii][Ll][Dd]*'' It could still be gated behind a style if it's a concern. dana