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#70036: a fix that Date: Fri, 19 Apr 2024 17:32:24 +0300 Message-ID: <86a5lpbeyv.fsf@gnu.org> References: <4e670617-6483-4159-a5cf-27a921764c38@email.android.com> <865xwddf5w.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4670"; mail-complaints-to="usenet@ciao.gmane.io" Cc: felician.nemeth@gmail.com, 70036@debbugs.gnu.org, theo@thornhill.no To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 19 16:33:05 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 1rxpIW-0000xM-Qk for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Apr 2024 16:33:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxpIL-0007QE-I5; Fri, 19 Apr 2024 10:32:53 -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 1rxpII-0007O8-Uq for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2024 10:32:51 -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 1rxpII-0000jH-MD for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2024 10:32:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rxpIW-0000FB-MR for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2024 10:33:04 -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, 19 Apr 2024 14:33:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70036 X-GNU-PR-Package: emacs Original-Received: via spool by 70036-submit@debbugs.gnu.org id=B70036.1713537179881 (code B ref 70036); Fri, 19 Apr 2024 14:33:04 +0000 Original-Received: (at 70036) by debbugs.gnu.org; 19 Apr 2024 14:32:59 +0000 Original-Received: from localhost ([127.0.0.1]:58509 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxpIQ-0000E9-SN for submit@debbugs.gnu.org; Fri, 19 Apr 2024 10:32:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxpIN-0000D3-Kp for 70036@debbugs.gnu.org; Fri, 19 Apr 2024 10:32:57 -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 1rxpI2-0000hs-VU; Fri, 19 Apr 2024 10:32:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=2D65E7IGJ9ZDVKUQznDHvZymis4xo95v5CaEFT2n9zo=; b=dyeOJDpwJ0Q531ZEk2ki 2it7FGuQCv8+pYdiok2sWsKfKC+a4tHTyYZBVvQid2rANFC4HYrpfRJiPhZdkn/p++m/mftY2XgKr 2nW9k/0fllOE4UooRIJ020sQkanbT0elbe5C6Eu+kxihryNv31/Dc26ptKWFES4ytI+lkUhIVb0gq 7yilIvJG5eQerSN3rabnVWSDqADf/ELq3FmU2N3bDvuXd/2QQPfakS9d+FlKzJ6+BN9Y7UYfK11Rj rN/uzMiYwTpFpey8nMvCCks5RTq7D3CPW/pliwUkndFjkxMTnuGbMPx9Mvf9T69+59OR3rhhgnDB6 bAxmB+tFS4JUQA==; In-Reply-To: (message from =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= on Fri, 19 Apr 2024 13:54:23 +0100) 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:283685 Archived-At: > From: João Távora > Date: Fri, 19 Apr 2024 13:54:23 +0100 > Cc: Theodor Thornhill , felician.nemeth@gmail.com, 70036@debbugs.gnu.org > > On Fri, Apr 19, 2024 at 7:45 AM Eli Zaretskii wrote: > > > Thanks, but that is not what I asked to provide, for us to make a > > decision in this case. > > Could you please show benchmark times of the old code (before your > > changes), the code after your changes, and the current code in Git > > I just noticed this and think a comment needs to be made about Eglot > and performance measurements specifically. > > If a good `benchmark-run` or invocation can be made to measure a specific > problem, it is usually a very good tool. But in Eglot, it's rare (*) > > What some in this discussion may not understand is that Eglot works mostly > asynchronously. The user invokes commands that ask something of the > server and that server will later respond with something that is hopefully > still relevant somehow. On-the-fly diagnostics work like this, and even > startup can be asynchronous. So any slowdowns are usually felt subjectively > in input lag across a session where the user is doing some work. > > More often than not, there isn't a > > (benchamark-run 10 (eglot-foo )) > > that can tell us something useful. It's more like "I feel diagnostics take > longer to appear", "ElDoc spins my CPU fan", "completions feel laggy", and > things like that. benchamark-run can be unusable in this case, but primitives that measure time are still useful, even if one needs to insert some special calls into the code that measure time. > So that's why the best way to communicate these problems is via a profile > accompanied by the usual bullet-proof Emacs -Q recipe. It should contain a > clear description of when profiler-start and profiler-stop are invoked, and > what the user did in between. And that's _exactly_ what Theo did here, > and was useful to me: I reproduced his results perfectly. Those profiles > easily tell us who the hotspots are at the Elisp level. The profiler is not very useful in such cases because it doesn't provide a clear picture of the time it took some code to execute. Also because typically there's a large portion of it that points to irrelevant functions line execute-extended-command etc.