From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#70216: 30.0.50; self-insert-command doesn't respect create-lockfiles Date: Fri, 05 Apr 2024 16:03:31 +0300 Message-ID: <868r1s55cs.fsf@gnu.org> References: <87zfu8w07c.fsf@thornhill.no> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36341"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 70216@debbugs.gnu.org To: Theodor Thornhill Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 05 15:04:13 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rsjEr-00099r-9i for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Apr 2024 15:04:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsjEc-00058c-HK; Fri, 05 Apr 2024 09:03:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsjEb-00058E-QG for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 09:03:57 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsjEb-0005ty-Hp for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 09:03:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rsjEg-0002OA-TF for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 09:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Apr 2024 13:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70216 X-GNU-PR-Package: emacs Original-Received: via spool by 70216-submit@debbugs.gnu.org id=B70216.17123222309079 (code B ref 70216); Fri, 05 Apr 2024 13:04:02 +0000 Original-Received: (at 70216) by debbugs.gnu.org; 5 Apr 2024 13:03:50 +0000 Original-Received: from localhost ([127.0.0.1]:35415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsjEU-0002MN-4J for submit@debbugs.gnu.org; Fri, 05 Apr 2024 09:03:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsjEQ-0002LS-DV for 70216@debbugs.gnu.org; Fri, 05 Apr 2024 09:03:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rsjEE-0005s9-SM; Fri, 05 Apr 2024 09:03:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=5qv2PHmfDgGjRIjJPeosyIgmUxZTz/G9hjsKf0kgUaE=; b=OK1DmojBIS31 1Cv7R1WlBkbsY6+JWEM/cdm4yKvM3Ehm2mMBmpjnKYowCuRhDCxIZ2iLA/AgZtTn8A/jqTOdoP1Wc Zb4p/ZWJ482AH8yNZgzMZDxvyVQOhNa+0yvCbo0vjEk7spuNnDzDEwFE0UrlpOq1zv1p5s2o/+fJg wh46WUYRyo46DfH0xHIrRHfbRAhkepSWSKQoczJekUyOcIqFT1BUk25j5cR4wnorNaxiS5qlcEO7c rr57V8twIpRbe8AxRk5AGvZ+G6dTjHLfMh2NAqIO6K8fVe4huKG0OnfJ9pEM/smCX8AaOhdSRBAbb F9jxilOhVM/2/X8E1T82Fw==; In-Reply-To: <87zfu8w07c.fsf@thornhill.no> (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282704 Archived-At: > Date: Fri, 05 Apr 2024 12:52:39 +0200 > From: Theodor Thornhill via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I'm digging more and more into the internals of Emacs these days, and > while tracing input lag performance i noticed that we don't respect the > create-lockfiles option, at least not fully. > > The documentation states: > ``` > If the option `create-lockfiles' is nil, this does nothing. > ``` I guess we need to fix the documentation, then. > However, the nothing is postponed until later, inside the lock_file > function. This means we won't cretae the lockfile, but we will get the > truename-buffer, verify visited file, etc, on my system amounting to > some time spent which I thought I opted out of. This is on purpose. We decided that create-lockfiles = nil is meant to disable the creation of lock files, but it is not meant to disable userlock--ask-user-about-supersession-threat, for example, which is an important feature we don't want to lose just because the user doesn't want to have lock files. See bug#53207 for some discussion of this. Bug#49507 is also relevant. > Along with a patch that fixes this behavior I've added 4 screenshots of > graphs taken through intel_pt tracing on trigger of self-insert inside a > c file. I don't think we want to install this patch, since we do want the file-change detection, which is done as part of this code. > The lock file related code can take up to a millisecond on my system, > but is usually in the range of 200-300 microseconds. Lock files and file-change detection are Emacs safety measures that are important on any modern OS. Disabling them because they eat up CPU cycles is wrong, from where I stand. That said, hundreds of milliseconds for 2 calls to 'stat' sounds excessive to me, so please tell more details and try to show the breakdown of this long time. > It seems there was some cleanup/changes around this behavior which i > believe caused this as a regression, from around 3 years ago. I _think_ > this commit: 9ce6541ac9710933beca7f9944087fe4849d5ae9 There were more changes there, see above.