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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2442 invoked from network); 14 Nov 2022 03:39:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 14 Nov 2022 03:39:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668397168; b=gfGBU7fb0PnJR5podVJ8XX/BqQca7plE4b/cqJbu1vAm7mooWkLoNblJcH81MDV0+eXfiJ39Gd QbNrRFlfegyFvJ1I493XVf6hKGcHIbpmQQb21/muDLXCfUrJdFp1NfvqbFyKdgfNOEyI3ZrOiZ cyBi2Q2lz1ipjTyV3DNxWMIeKcf3vGPb56Y9qaVEgpLDQndCdTTNTWWcKaeREu6OGNwYismQZT IdB0n6m4x2vaN6zi4LoUWbSqqmJfhFFqFMalSBKyDs5WD7WvPRSsS5vUfFiyZ05VvM/CvGmhMe 1O14R2jdYgBQaYXiq3jfX8NyfsaAcXIoM0UTfQwliZYRsA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=jpgrayson.net header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=jpgrayson.net; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668397168; bh=vJqddO6G4ju84pbmSumDcKOYuQicXaM6ufggeUqN/b8=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:Cc:To:From: Date:References:In-Reply-To:Message-ID:MIME-Version:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=evB7BKJXsBAQSrRqRCrSQVgW4r08MZf7wGOV+/CBgPJ6xxKh1LD3toK+jdPK7NdpBoaUxrtq0k T0+XuGaVN7BrugetN7eBP9ih32754Fl+BArgFoQvafjQDrVJTr93muhDiZOFHGdTsJlfPy3Uhw k8NTdB5YciR36v5e4BUIeiDla2/AQnNG1BTPQOaSO/EqRCVWM24qMgHUkof+Ix3Rf2kGF/CGTf lkwLi3DeMsoGYk6ZDzi9AAWRSygFDpD7RBCGYx+SIG9ABv49WZ8PujtHgkYmqC5/KyR5vDu1Rw agEiAvywaKmLo5JmvnNVQ8MxDLBz0/a34sJkKpgEzTYecw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Subject:Cc:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=hd68sp7mQAFSHwJId8KjusZ1XpN7U+R1ny9CdsxNzkw=; b=cJFXjxMWVVN4kJhoW/EdbXCwFg DZhQcRngxugaHpVWJTlprE9c5ED6M9StPgZFH4MKweVnJXgg4XP8ZtP5bA3VN4zv49T8NXGBW4uxR d1wFZXNiODjxCh42YE7PI7iHNcqDxoBJ0IF+qqG69iA7xF9h43Hg5DQa8j78iO0ZS1RMMprKEgtkm YnhNpk93AsYnQ5sbrs1fs/OVK+p8clvD9a2AMzV550beUxIf1KfrjEAt8GUthklmA5XrZWTGWxRot qs0wiFJ/vFjrKQKf5AYLX179PFbjnULkDgDjdBw425uYYvULYouO90AMxD/7AAUy1t622sUVESVdk 8u5vDP2A==; Received: by zero.zsh.org with local id 1ouQJj-0007W5-1H; Mon, 14 Nov 2022 03:39:27 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=jpgrayson.net header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=jpgrayson.net; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:46987) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1ouQJR-0007CU-BG; Mon, 14 Nov 2022 03:39:11 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C49055C00E9; Sun, 13 Nov 2022 22:39:07 -0500 (EST) Received: from imap48 ([10.202.2.98]) by compute4.internal (MEProxy); Sun, 13 Nov 2022 22:39:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpgrayson.net; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1668397147; x= 1668483547; bh=hd68sp7mQAFSHwJId8KjusZ1XpN7U+R1ny9CdsxNzkw=; b=t WQHFV9Q2zkHA51v9QyTn2gPdXDNb16wbEHm/B7KNo1IqyyWkKVlFkvg2xudM/ZEb XnElBs7jattzIXzkGK0huaWF/kHKMTzN+8hOxrXBikzFcs3FEpVnjVNUXou3BabZ j/nJTN3nd27bBpM1xHos/s6UNb57m8TndiJN4edHZSmTSVKz6ZQPkT1wEQDJLPFF 4pMEOXvHBkWirV+M5wjg5RnNByroxyzC42hiKkg/fZ1U40xxDw7NIm2x552UUmCQ SAJHjLlLhrcyDtInsepa3g5je3K73zFbj3CixFCGe0OvWI0tz8ykPgfO+UguNJi8 5tIw9vWJK7MfiNYCZuvQQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1668397147; x= 1668483547; bh=hd68sp7mQAFSHwJId8KjusZ1XpN7U+R1ny9CdsxNzkw=; b=n 75rCzd9+fTScYmF5znXmhImashdYoLGFZy07/IIlJ12e5mgjYl5fl78NKoHITWtQ n/lbbSo1W1P1BqSl4m60fVPYbZCW8xKoV+tlJ1BBc2GJ/jiqtd0gjj22xFcnNHhR QwLKvwzUiLhUiOFk0Ws+NsToscmsqSyw6blr9a71CFS2gnCdN6PbFL4OkMPq94vR Xar65bQ9xFeZ28eKiR3yfLRlFq/6iZVsj8QO6qEdrJA4Lep9Xf9CWLrEXS5rMCZ9 zzLoDUCuABo1JtKbOZMDt1XNELwfUHKRn++V89epXreMnS1REy2hsWBiwhBpHX9P Z2g3k3hZqi/kDW2TgVLlg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrgedugdeiudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvfevufgtgfesth hqredtreerjeenucfhrhhomhepfdfrvghtvghrucfirhgrhihsohhnfdcuoehpvghtvges jhhpghhrrgihshhonhdrnhgvtheqnecuggftrfgrthhtvghrnheptefhkedutedthfdvke ejhfehleefkeevudfhvdffveefleetveehveeggfejuddunecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvsehjphhgrhgrhihsohhnrd hnvght X-ME-Proxy: Feedback-ID: iefe944c0:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6E9B231A0063; Sun, 13 Nov 2022 22:39:07 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: In-Reply-To: <20221113043040.GG27622@tarpaulin.shahaf.local2> References: <20221101030429.38029-1-pete@jpgrayson.net> <20221111114928.GF27622@tarpaulin.shahaf.local2> <603fd1b9-1b11-4729-99cb-19e1c4ef8b37@app.fastmail.com> <20221113043040.GG27622@tarpaulin.shahaf.local2> Date: Sun, 13 Nov 2022 22:38:50 -0500 From: "Peter Grayson" To: "Daniel Shahaf" Cc: zsh-workers@zsh.org Subject: Re: [PATCH] Remove StGit patch detection from vcs_info Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 50962 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 Sat, Nov 12, 2022, at 11:30 PM, Daniel Shahaf wrote: > Peter Grayson wrote on Sat, Nov 12, 2022 at 09:46:02 -0500: >> On Fri, Nov 11, 2022, at 6:49 AM, Daniel Shahaf wrote: >> > [re #2]: It sounds like StGit=C2=A02.x support can be implemented a= t the cost >> > of one fork(2) for those who don't use StGit and under a microsecon= d for >> > those who do. That doesn't sound like a deal breaker at all. >>=20 >> Running `stg series` with StGit 2.0 takes about 12ms in my environmen= t. >> StGit 1.5 it is about 32ms. Not a microsecond, but perhaps acceptable >> nonetheless. >>=20 > > To be clear, are these figures the duration of the =C2=ABstg series > --noprefix --applied=C2=BB invocation? Yes. > What's the impact on people who don't have stg(1) installed, or who ha= ve > stg(1) installed but are currently in a worktree that doesn't use StGi= t? > I.e., are those figures immediately after `git init`, or in a worktree > that has a StGit patch stack, or? Without stg(1) installed, the cost would be however long it takes zsh to determine that the executable is not available in $path, which is ostensibly very fast (microseconds?). If stg(1) is installed, but run in a repo with a branch that has not been initialized with `stg init`, it's still about 12ms. Almost all that time is taken just to initialize a libgit2 Repository structure, which is used to interrogate the object database to determine whether a StGit stack is initialized. > In general, 32ms for everyone might be too much (what if another > third-party tool wanted to do its own elif branch that also spent 32ms > for everyone? That'd be 64ms in total and counting=E2=80=A6). Well, that was my original thought as well and why my first patch simply removed StGit support from vcs_info. Note that 32ms is on a particularly fast machine and I stand by my assertion that Python startup time can be on the order of hundreds of milliseconds on more modest machines and/or with older versions of Python. > However, if the 32ms would only be seen by users of an EOL'd stg(1), > we can relax the threshold a bit. On the other hand, if it's 32ms > just in cases where stg(1) is used=E2=80=A6 well, there doesn't seem t= o be > much we /can/ do there. The relevant scenarios: * stg(1) not installed =3D> ~free * stg(1) < 2.0 installed =3D> 30+ ms * stg(1) >=3D 2.0 installed =3D> ~10 ms The worst case scenario would be for someone where stg(1) <2.0 is installed, but not used. This would create overhead in vcs_info without any value for the user. All other scenarios seem to end up with the user getting what they paid for. > Perhaps hide some or all of the work behind an opt-in switch. (For > instance, the default settings show only the topmost applied patch, so > if it's possible to tell stg(1) not to emit any other patches, that > might help the code finish more quickly.) Limiting the output to only the topmost patch will not have a material effect on the runtime because of how the overhead is dominated by libgit2 initialization. So an opt-in switch would have be all or nothing; either try to run stg(1) or not. Also worth noting is that changing StGit support in vcs_info opt-in would be a bit of a regression and would add more configuration surface area. Not sure if/how the zsh project does versioning for something like this. I did not include such a switch in my latest patch because of these issues. > From the "Is your computer plugged in?" department: Is that 32ms figure > on hot disk cache with .pyc files already having been generated? Yes. I used hyperfine(1) to do these measurements. Pete