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#65760: 29.1; eglot performance issue Date: Tue, 05 Sep 2023 19:22:15 +0300 Message-ID: <837cp44mko.fsf@gnu.org> References: <87il8o62dw.fsf@ya.ru> 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="40412"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65760@debbugs.gnu.org, glebsmirnov0708@gmail.com To: Ivan Sokolov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 05 18:23:26 2023 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 1qdYpq-000AFX-CY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Sep 2023 18:23:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdYpV-0004cl-RZ; Tue, 05 Sep 2023 12:23:05 -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 1qdYpR-0004OZ-Ol for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 12:23:02 -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 1qdYpR-00061t-Go for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 12:23:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdYpR-0005ON-Ru for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 12:23:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Sep 2023 16:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65760 X-GNU-PR-Package: emacs Original-Received: via spool by 65760-submit@debbugs.gnu.org id=B65760.169393096620706 (code B ref 65760); Tue, 05 Sep 2023 16:23:01 +0000 Original-Received: (at 65760) by debbugs.gnu.org; 5 Sep 2023 16:22:46 +0000 Original-Received: from localhost ([127.0.0.1]:58210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdYpC-0005Nu-0p for submit@debbugs.gnu.org; Tue, 05 Sep 2023 12:22:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48914) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdYp9-0005Nf-Gx for 65760@debbugs.gnu.org; Tue, 05 Sep 2023 12:22:44 -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 1qdYp2-0005zP-Lu; Tue, 05 Sep 2023 12:22:36 -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=/YEsyc30rdb6Xyi8q/FzLy2weLBP6bWrC8DCbdUsRe0=; b=MLuLU+AL02eu/S2PQwmM r7TcqNWC+1R0QvwAZZ8MhZ3SFoAGqdLL2bI53ueL1wM8o0gTCdrT8VPVBqCVPuI2o8SR7OQNlDEts oCWRiXleBbvnMQor1SLIS/pz1iX2a8tW3qJQUUbnup+5KJaf5NdGWVMVjkMaU6tjm0Nbkyeg3r6dl Orfcby1hQtvn8KAEgBMEZOXLywOBU5EsMCEaIMTCwrQVuORgl6ORWCCdMENaMw2pX8+QOMBNfxXUI R+E6NJ0VxBTIvWvyIxd2ic8ZVSQGTtSkZeLwiYycbiwt9PYJNz624sW/DAdFliNVXyAYK/XMfDJI5 1n+Cfq5TtPOhHA==; In-Reply-To: <87il8o62dw.fsf@ya.ru> (message from Ivan Sokolov on Tue, 05 Sep 2023 18:55:23 +0300) 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:269376 Archived-At: > Cc: 65760@debbugs.gnu.org > From: Ivan Sokolov > Date: Tue, 05 Sep 2023 18:55:23 +0300 > > Глеб Смирнов writes: > > > The problem is that running eglot with rust-analyzer on my project > > causes major input lag. Profiling shows that the problem is in > > synchronous and slow function jsonrpc--log-event that is called on each > > server request or response. Disabling this function with (advice-add > > 'jsonrpc--log-event :override #'ignore) solves the problem. > > To be more precise the problem is that jsonrpc--log-event is pretty > printing every reply from the server and they can be quite large and > nested. I am attaching Gleb's profiler report, as a screenshot, but > this should be enough to give a better understanding of the problem. Yes, the real CPU eater is pp-buffer. But I also see that jsonrpc-request took a substantial amount of CPU time, and since jsonrpc-request runs from a timer, it is a good candidate for explaining a perceived lag. Can you tell if this profile was in an Emacs build with built-in JSON support, or was Emacs using the Lisp implementation on json.el?