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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5522 invoked from network); 29 Jun 2021 07:17:32 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 29 Jun 2021 07:17:32 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1624951052; b=iyLb5IsP6Ld08uyg3tPEl6DMjAQLPibYtUkRZ0yLVgOcbz5Aj6ON6gXcmCGvKQ9J4JJm+q0hYn TLExNDwu/lZrfU5RcSVYGCGW3muuw2Eod3hN2nkZgH+crBUI2gjaYj6Utbmgqk8c8ylS0DKgzj uG672TomFp3olg2ODRJ1niQ1LU2snzxq+yKNu30KMKVRpqepIzZ9R/LENZTKk38cjFVsmv84Wi +Kh+0/e3efvzBMdDvxqckOFTgzSqG6t377+F9iRkRSs4qJjiwPwswWM7OUCWVoNjf5bwdAIfog qf305kg95bBE7axhn5zrD3LPaCfv1lAvHFSeuQLykORzqw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-il1-f171.google.com) smtp.remote-ip=209.85.166.171; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1624951052; bh=77IrdU/oHN2jFJcQUifTRfwlV7wVgj7+6V0m+e9wMb8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=xH2wOwIsUX2n7NJr6PDDZOtTBx/icPghIggajxpSWDnJrAX5ByCleKxt1hSniIvOnYRRJvZt3x 7aMqnfzHkZ5kjnK7Udy2RxjSyH1Sy0hapfNHd3E/Y2O7Ct4md3jFtVUp/f1uYxktlpunCEZf5K rKSXOd6A9v2v8Enjhvb/Rokdt2ufg7OcDY2zXfM9kalFJ8fXG1Zs5Jmz6gaHAm9r7Oiscme9/1 alvrr4YbbOK26D2GFzqR4Hvn1EbYLMSw0wSzYTvZYfVT/AWrqVsFN7UPbxyYNqawRKEbv/XB9I mVr+zFPBsuD4GBFQ31YIAXD1FkXJ6dod52UJJhvAI6wj4Q==; 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:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=LrXj0CNwUbE+CciqpX/b4/ACQro1wfMj0KY1hNtW2Mg=; b=EmwheC7eRAe4EEjjVrpuU/cyQW DCsjb1JX57IvnN/RLM4OoeuzD84JY2kYy+mbT1EMj4tzkUHLYfnEd1q62avgUAvq66lNVYNn6C3sI RnxpUy1077F76ugpfpWrGIsK24C4ZDpQ1xIqMPOr7n6ixrIL19wxHi75kZtFXgdMeJ2OkXr2aAEdI 593riNh1K+HPp2CS3z9PBAkk1RuLhGnY1Q4jTGmzG1tXkM17/bUQCjFsBgSv51wyZuxdKODGXhboy JA7By+XkVaenZhuACLt6oWprVrlTdpVp2sPZ/E7dOqJH8inl+FR0dceBD7GLjrIrjUWAYcb/+p1j9 MAVA4THQ==; Received: from authenticated user by zero.zsh.org with local id 1ly7zt-000OHR-E1; Tue, 29 Jun 2021 07:17:29 +0000 Authentication-Results: zsh.org; iprev=pass (mail-il1-f171.google.com) smtp.remote-ip=209.85.166.171; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-il1-f171.google.com ([209.85.166.171]:44999) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ly7zK-000O0r-9C; Tue, 29 Jun 2021 07:16:55 +0000 Received: by mail-il1-f171.google.com with SMTP id i17so19961918ilj.11 for ; Tue, 29 Jun 2021 00:16:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LrXj0CNwUbE+CciqpX/b4/ACQro1wfMj0KY1hNtW2Mg=; b=PanR6VeIVZI0C3EsJhYBqbhwrlZcjIMFkvFCfHfPjjnCh6N1E9GPpLfGcsDAHN+yaX F2STjQqAeVgjLjzXpTxdwRyG7o2I1IZGlA9Q4DpR2GSIh2L5TCW5BhDMep/gUkpP4JDE 8LKrYim0dkakda5B5bHM7Xfxn5kkdXkfOIO00b6QuLNb8S6wFyyIEiwcekjVOtnsErI6 1FHYtFEuwuGJHwudBk0RCBaVtkOGIF3IZ+sRxn63F3E7oBR9AgeXKwDzUZX/JhB+jzrD EvJIk1OALMCc78G9uvwfrMuw2De48WuQZkL6jKJu/18yfrAXxKrcOcj5Dst2z2iPwr4Z dzNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LrXj0CNwUbE+CciqpX/b4/ACQro1wfMj0KY1hNtW2Mg=; b=R0krd/mw0YaRp2jt5BznjNs95XMLCCfp9zmHIYtkcL/y2GdVKhSWT0HvcAkIoax08v FTuiwxhvFX47QT2t4igkiz4rcEn5V6crfQUueQZlbFeWdkQ/bgt/ovfQZsQZBWS+yGM0 mh8rBFg3TOjxsa0pY/xPUGfeJf1uEmgm0k/oTfXsfyODDhEYn75KPQ5RDZNcF10jBYxv Wd+E9RgGtxPX9XetFpN4wr/2Zyomq7gxHovu28AtuS0FmS/LS+/zGZPnncuOV9MDJ1oy JESnaHHDGyzZYjxcVBjvYzjalcBRBPiB1sJYKgl2dikL4uKqZuAxQhBKqOkhCIZFr852 iLNw== X-Gm-Message-State: AOAM532E15cbF9CYP5lNvMk7uNuUOYZkghwYreF2bwD6cS4Xp9XXKzGQ EzGg3Gdw2bM34p8bWeQ8wv+JnTGn9KdpPbIjupQ= X-Google-Smtp-Source: ABdhPJz7eMldRYN+CdjAsJUlJzRo1SHa04Xw38Gn8aDPF+E/Pce0G9VCnDhLwUFNZ2tMFXLHqUqUbZaMM/6OctoHvBo= X-Received: by 2002:a92:1944:: with SMTP id e4mr20636388ilm.186.1624951012989; Tue, 29 Jun 2021 00:16:52 -0700 (PDT) MIME-Version: 1.0 References: <20210626230903.43ba5516@ratham> <20210628155736.6982862a@ratham> In-Reply-To: <20210628155736.6982862a@ratham> From: Roman Perepelitsa Date: Tue, 29 Jun 2021 09:16:40 +0200 Message-ID: Subject: Re: [PR] vcs_info-examples: optimize +vi-git-untracked() #76 To: "Suraj N. Kurapati" Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 49136 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: On Tue, Jun 29, 2021 at 12:55 AM Suraj N. Kurapati wrote: > > On Sun, 27 Jun 2021 15:03:17 +0200, Roman Perepelitsa wrote: > > On Sun, Jun 27, 2021 at 8:07 AM Suraj N. Kurapati wrote: > > > Speed up the prompt on large and/or deep working directories [...] > > > > Do you have an estimate of the speedup? Numbers from at least one > > repository on one machine would be useful to see. > > I see a 4x speedup on a large Git-enabled home directory, as follows: > > $ time (git status --porcelain | wc -l) > 212 > 0.01s user 0.02s system 0% cpu 9.021 total > > $ time (git status --porcelain | grep '??' &>/dev/null) > 0.01s user 0.02s system 0% cpu 12.294 total > > $ time (git status --porcelain | grep -q '^?? ' 2>/dev/null) > 0.01s user 0.01s system 0% cpu 3.097 total Thanks for posting these numbers. So with your optimization it takes 3 seconds. That's quite a bit. And I suppose that if you were to remove/add/ignore all untracked files, it would go up to 9 seconds. Ouch! Roman.