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:25:28 +0300 Message-ID: <835y4o4mfb.fsf@gnu.org> References: <87il8o62dw.fsf@ya.ru> <837cp44mko.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="19491"; mail-complaints-to="usenet@ciao.gmane.io" Cc: glebsmirnov0708@gmail.com, ivan-p-sokolov@ya.ru, 65760@debbugs.gnu.org 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 Tue Sep 05 18:26:15 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 1qdYsX-0004nv-T5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Sep 2023 18:26:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qdYsM-0000sy-Qa; Tue, 05 Sep 2023 12:26:02 -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 1qdYsL-0000si-JP for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 12:26:01 -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 1qdYsL-0006eo-91 for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 12:26:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qdYsL-0005Ta-Pl for bug-gnu-emacs@gnu.org; Tue, 05 Sep 2023 12:26: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:26: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.169393115721040 (code B ref 65760); Tue, 05 Sep 2023 16:26:01 +0000 Original-Received: (at 65760) by debbugs.gnu.org; 5 Sep 2023 16:25:57 +0000 Original-Received: from localhost ([127.0.0.1]:58227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdYsH-0005TI-1H for submit@debbugs.gnu.org; Tue, 05 Sep 2023 12:25:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdYsD-0005T2-M5 for 65760@debbugs.gnu.org; Tue, 05 Sep 2023 12:25:55 -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 1qdYs7-0006ay-IM; Tue, 05 Sep 2023 12:25:47 -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=AlmpBptu5LneHWAlYromeKHfJjmH/UfNjlEClsFuRVE=; b=ZraPjCqJ3enamkzwdAaK tT7PRsG8PKRMDI/zf21SjPUEqL20KemCbCMZ45p5nVtaQpqIeNeezlPOJj1Q+ILxg6R/sR9V5bSz1 SVeHnJcc1GfsK796jvj6bn5yJ10+O8tY57+RLqDXdW69Q8y9wnXmmuYgZBqHHaJct/3KkUX7w0zhb B7Y1L5f8zy7jA6No5/skAOqstl2b7PJ3WVJWRd1TEyB3Pw1mZ/MBLWr+CNyJ7s75qV8UeYEyvsJl3 tJClxX3ZF9lHzt5XcF1CneYrsZtZq46dIwq/zOlV1PwF6L18t0qz/bKm5BxFBijQO1UdAEQW1swaQ Hvb8pp0l6xRVrw==; In-Reply-To: <837cp44mko.fsf@gnu.org> (message from Eli Zaretskii on Tue, 05 Sep 2023 19:22:15 +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:269378 Archived-At: Adding João. > Cc: 65760@debbugs.gnu.org, glebsmirnov0708@gmail.com > Date: Tue, 05 Sep 2023 19:22:15 +0300 > From: Eli Zaretskii > > > 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? > > > >