From unknown Fri Sep 05 20:56:14 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#79361 <79361@debbugs.gnu.org> To: bug#79361 <79361@debbugs.gnu.org> Subject: Status: minor jsonrpc optimisation suggestions Reply-To: bug#79361 <79361@debbugs.gnu.org> Date: Sat, 06 Sep 2025 03:56:14 +0000 retitle 79361 minor jsonrpc optimisation suggestions reassign 79361 emacs submitter 79361 Mattias Engdeg=C3=A5rd severity 79361 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 01 14:59:23 2025 Received: (at submit) by debbugs.gnu.org; 1 Sep 2025 18:59:23 +0000 Received: from localhost ([127.0.0.1]:58487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ut9kR-0001In-Dm for submit@debbugs.gnu.org; Mon, 01 Sep 2025 14:59:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:45544) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ut9kO-0001II-CS for submit@debbugs.gnu.org; Mon, 01 Sep 2025 14:59:21 -0400 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 1ut9k1-0002AV-UC for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2025 14:58:59 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ut9jz-00068b-2C for bug-gnu-emacs@gnu.org; Mon, 01 Sep 2025 14:58:56 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-55f6186cc17so3644014e87.2 for ; Mon, 01 Sep 2025 11:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756753133; x=1757357933; darn=gnu.org; h=to:cc:date:message-id:subject:mime-version:from:sender:from:to:cc :subject:date:message-id:reply-to; bh=sV+z1YoUWGf1YuTSiQxr4BFmdzEgaK4EDJlSytbYlXA=; b=hzTHcpruKoOCum4UNdTfCtHUYGxtBsqjdZaeoUW0YFFMdfqM8UtJkhF7qvgwFQF+FN xmOCvsqcF2imVwl2Yga7SMxLt9XB5wAGPbjgewWmXLxpcBxIuKrMbhxHCA95yeyw9RMV 6hLK03KM4N95CDuvu4DMyR5cAlPILv0VC5uTBLqEaepDdO/9bQJ9TZiwE2uPlQqhVyEj 0h2tYHab+GaYRrFMpXfT1ofEYsbGJ+LafutyH3fnOvuCLRr/47N2AwPfRXtGdN5tNhU2 om6nOVfwE9ZAEwHeALgUTwEWQLPgVf2VGpgq3hQVH8GSKLBS31Jzp0r0puecNjVg7Wwa YXLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756753133; x=1757357933; h=to:cc:date:message-id:subject:mime-version:from:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sV+z1YoUWGf1YuTSiQxr4BFmdzEgaK4EDJlSytbYlXA=; b=wfDqd8lydizgEM282lOy6a0l/UDRqJrtzsM/+W50odIbwzzfXL0YQfr0wYlBmrzN+Q 3mzO3UyIHtR62uzZtY3D10DiEYbzUyuMSxlhE4pKDV0K2QE3LjjAwiarwjCMocO9ipfX WrkZIWoB0jNJKji8zlzDb4AsNUk+qzESIxl3jmHVZ8P7VzajjvAa6m3gx7HitEbhH138 yE1L8MwnJxLB+dfWgtoImMvblB2XzDGUOv5ghrBdFtVS7jPODBMa8bE3NOMIKt1EAdeP w75QOe4VaVXITmTSpSsf2VaEjqIfSbqJD01ylu8gabRC/js9UJFhrxgtFsoyEsNNSFIQ oB/A== X-Gm-Message-State: AOJu0YwPhmO3Rikfnsm9CZCfabOfZD9lEej5357JYidQZ3wJjPWkWfWU Mh39hkXi2cLCyX+zUJPTJUFHV/NxcJ1UAdrc/zRsAZlfUgGtHe95ver1RFeLSoz5 X-Gm-Gg: ASbGncueR27DMGznTweMCd40EaVNDNzt6asyDeTDxibllMapituNymjd+yDaxn5Gt5U 3QET2hfTi/MN7RePNfa/IPa2o6jKyY5sNSQp0sjAiUUYMuPsbOZJnOEqtr3yyAAYB7lgSpRlmfe jlqcYU5fJ6NZ563i+K+wPNXXI5gCSAUka2ztZ0RQyrZQn04DX/p7SCkXlnz0HXSXA3Q+EG/eDCn vXtVbXOdyUqfwnJPQOI5b1iPQj45ahzgFEfwchJVXX/dzTfKhyrnmPC25rKTPr9eiaX1XUceccu kBZuCKBu1fvfz2PaH3QfIS04tK52pZK2ewu7DVsPMxWkFruc3Wcg/F0KiQmZEk1yIUoUq00rgJ4 cuJJOIjJ7UMBMJKiZf7IEAKY7nzy5InzQ3XYmxXcST6/WeaaBuE0NjKFI2ekrhQGLLWxbMEKhMY vbks4FzAXZ9ZlkAQLnvUnYzv4= X-Google-Smtp-Source: AGHT+IHg+Aohz+mtQWtz5/8ygBL4aCM8mJg2W8pwGfZItCz7wyYYZUmq84fSz3OidmD57qR9HyDuNQ== X-Received: by 2002:a05:6512:4608:b0:55f:4107:ac46 with SMTP id 2adb3069b0e04-55f708bcdeamr1750439e87.25.1756753132477; Mon, 01 Sep 2025 11:58:52 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5608279020fsm17194e87.83.2025.09.01.11.58.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Sep 2025 11:58:51 -0700 (PDT) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/mixed; boundary="Apple-Mail=_1974CD01-8418-4761-9DB0-03C26FB4E505" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: minor jsonrpc optimisation suggestions Message-Id: Date: Mon, 1 Sep 2025 20:58:50 +0200 To: Emacs Bug Report X-Mailer: Apple Mail (2.3654.120.0.1.15) Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=mattias.engdegard@gmail.com; helo=mail-lf1-x12d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Apple-Mail=_1974CD01-8418-4761-9DB0-03C26FB4E505 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Emacs's built-in JSON parser happily accepts encoded unibyte strings and = buffers as input because JSON is specified at byte level. This means = that any effort to decode the input to multibyte first is wasted. (This = overhead is quite measurable in general.) For jsonrpc this means that for good performance, make sure the process = buffer is unibyte and set the process coding system to something like = `binary`. The filter function will then be passed unibyte strings. (The = `position-bytes` and `byte-to-position` calls become identity and can be = eliminated.) This should apply to both the old (libjansson) and new JSON parsers. The = old json.el parser (json-read) doesn't cope well with unibyte input = (unless it's all-ASCII, of course), so for the masochists you may want = some compatibility code. Here is a proof-of-concept patch, largely untested and untimed (well, it = compiles and passes the tests). --Apple-Mail=_1974CD01-8418-4761-9DB0-03C26FB4E505 Content-Disposition: attachment; filename=jsonrpc.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="jsonrpc.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 6c969120926..3ef8c504748 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -548,11 +548,13 @@ initialize-instance (set-process-buffer proc (get-buffer-create (format " *%s output*" name))) (set-process-filter proc #'jsonrpc--process-filter) (set-process-sentinel proc #'jsonrpc--process-sentinel) + (set-process-coding-system proc 'binary 'binary) (with-current-buffer (process-buffer proc) (buffer-disable-undo) (set-marker (process-mark proc) (point-min)) (let ((inhibit-read-only t)) (erase-buffer)) + (set-buffer-multibyte nil) (setq buffer-read-only t)) (process-put proc 'jsonrpc-connection conn))) @@ -578,16 +580,11 @@ jsonrpc-connection-send (id 'request) (method 'notification))) (converted (jsonrpc-convert-to-endpoint connection args kind)) - (json (jsonrpc--json-encode converted)) - (headers - `(("Content-Length" . ,(format "%d" (string-bytes json))) - ;; ("Content-Type" . "application/vscode-jsonrpc; charset=utf-8") - ))) + (json (jsonrpc--json-encode converted))) (process-send-string (jsonrpc--process connection) - (cl-loop for (header . value) in headers - concat (concat header ": " value "\r\n") into header-section - finally return (format "%s\r\n%s" header-section json))) + (concat "Content-Length: " (number-to-string (string-bytes json)) "\r\n" + "\r\n" json)) (jsonrpc--event connection 'client @@ -641,10 +638,11 @@ 'jsonrpc--json-read :false-object :json-false)) (require 'json) (defvar json-object-type) - (declare-function json-read "json" ()) + (declare-function json-read-from-string "json" (string)) (lambda () (let ((json-object-type 'plist)) - (json-read)))) + ;; `json-read' requires decoded input. + (json-read-from-string (decode-coding-string (buffer-string) 'utf-8))))) "Read JSON object in buffer, move point to end of buffer.") (defalias 'jsonrpc--json-encode --Apple-Mail=_1974CD01-8418-4761-9DB0-03C26FB4E505-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 02 07:10:39 2025 Received: (at 79361) by debbugs.gnu.org; 2 Sep 2025 11:10:39 +0000 Received: from localhost ([127.0.0.1]:60445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utOuM-0005GS-Kw for submit@debbugs.gnu.org; Tue, 02 Sep 2025 07:10:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41526) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utOuK-0005G1-RS for 79361@debbugs.gnu.org; Tue, 02 Sep 2025 07:10:37 -0400 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 1utOuF-0006Fy-Av; Tue, 02 Sep 2025 07:10:31 -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=wkgHdnNB96zOeO/QsATNo/YzoLfJrSVtMyDDJSPg1kI=; b=ey0dG5SicDJfLxPLFXjr ptHTgEBhUxGdFBqdL6kKiNXAToKoBD6s6HU6C94Ih20S3jQRd1x6KQ3msYhYOKOkS/lxtLFCS4Gew 71xqgxLdb7lTMkE8860/ur4alN7lhOmvehs3SrQrkQYDy26uwnMlB3ZDZ99Ze21Rfj7/a/MPMDe6M lFoufGCLGglo2nx/8V0nw+3QFZFN5NQDcF/BGMNMLoQkL+RNbG0iTCuI/369+xuFb6oqt20GwusEn X8Cjs7nvsfligprhqcfJT9i4iw4/c5VcELLMo9sAxmsaDfzuV+qJeb1sDaKY5U7xRI1prZ5OrZxR2 ELcvMkdOl75x0Q==; Date: Tue, 02 Sep 2025 14:10:19 +0300 Message-Id: <86ecspm7ok.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Mon, 1 Sep 2025 20:58:50 +0200) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79361 Cc: joaotavora@gmail.com, 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: João Távora > From: Mattias Engdegård > Date: Mon, 1 Sep 2025 20:58:50 +0200 > > --- a/lisp/jsonrpc.el > +++ b/lisp/jsonrpc.el > @@ -548,11 +548,13 @@ initialize-instance > (set-process-buffer proc (get-buffer-create (format " *%s output*" name))) > (set-process-filter proc #'jsonrpc--process-filter) > (set-process-sentinel proc #'jsonrpc--process-sentinel) > + (set-process-coding-system proc 'binary 'binary) Why not do this at make-process time? > (with-current-buffer (process-buffer proc) > (buffer-disable-undo) > (set-marker (process-mark proc) (point-min)) > (let ((inhibit-read-only t)) > (erase-buffer)) > + (set-buffer-multibyte nil) I would move this to make it the first thing we do in the buffer. > + ;; `json-read' requires decoded input. > + (json-read-from-string (decode-coding-string (buffer-string) 'utf-8))))) Should be utf-8-unix, I believe, since JSON requires a literal \n as a newline convention. And yes, it would be nice to have timings. From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 02 15:32:33 2025 Received: (at 79361) by debbugs.gnu.org; 2 Sep 2025 19:32:33 +0000 Received: from localhost ([127.0.0.1]:36687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utWk5-00014p-0b for submit@debbugs.gnu.org; Tue, 02 Sep 2025 15:32:33 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:44166) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1utWk2-00014U-09 for 79361@debbugs.gnu.org; Tue, 02 Sep 2025 15:32:30 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-55f74c6d316so3199067e87.0 for <79361@debbugs.gnu.org>; Tue, 02 Sep 2025 12:32:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756841543; x=1757446343; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=5S15HNLiMiM47msVBNPFLnlSyla2VK/cGRJNfZ9QZlU=; b=HwZKREyVWRuuil9o4vqwpb8Ml/6W6Z9ixNt9f+pkWnjeKghONqIjqZ+8FPbQoqETdj qZqoeZZeAf+MXphWwDENehQTXxXrmdpXsDN9jYhv0p3oIxsQGuvUKkU3NmzQ/iCu96M9 tzkYhdIGCuZW6BYUtl6KGXCtma5qdhB/5XcjGIiW2iioZmX4B5teEO7HWsOt1C4pGeN4 8auuEiXXX5y/QbIq/tn3241nipyvDwipV/J3Qs5Z4zAUiwyNZmqVD8BlMlZKfKZ4Gku+ p8LiOjDQCFsoz4s35i7J6+lh9JGIqwi0VgV+xOZ1W4X9NJXAustE1xV1ybyPFmvV+EZd K16w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756841543; x=1757446343; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5S15HNLiMiM47msVBNPFLnlSyla2VK/cGRJNfZ9QZlU=; b=MB1j9AX1IUGV3PpRR4oiZs/fQxIUFPBVDBWO8JQeTwwhazlsQgLW/k91m6JumMX3WZ cT1TO5AhDawjpbfSTu7ZeTsb7v3j0pD77MVJBnOn4TLjkyC9q4ivoi0by/v8eSYpSTDP PatwV6fKeySb9vWRSnxrgxwxs7h3dbsFn4Hmx25mIggHcudbaAHc7qAz9PZl/0I5gspP VxWRwnQN02BGm2PIHe5Zf6Lv+l1g2P0KdTW8OyWl5LDrF1pR33oSanc2sTjT2O2Xx1Ir 1ASO+N9Rhx/VRv284kOTYEM2PK5ARf+Ni/odr4g69Yqco1qimPMZaiqkBlieqcawxqHb 01+A== X-Gm-Message-State: AOJu0YwQo92w8e0/LBtMqYtw6C5Smx4QwViAI+qePHC5mHQdLfHj3hg4 QKPRhYlLmzcAgsDyQYCUBO7qqAgeme8DuA+SXmv0DJG3Y44UQTlyJVfH X-Gm-Gg: ASbGncso8NmzPNGmu/rmaWIOxTMbcenVOtwFQkR2qJJOsFRhE8XrK8ZuMdNhvOIhsOy /Q5xZb98AFXRGAilh1vrVfmf6TJveytuc9S8a65ItYbMi1uJLp46gpGsQCh68ZuY8RPB2qa+wOE MMEL3Vuct/iZ0kzkHSGKWLOb0EzX+tRQZc9TBKPerbEwWsD7/XKxB9n5qGHg1ubmjhmafkHe/hA L8w7Za5PvkY9H16kH4HqHlWdpx7WkE7/TJtJ5bd2NeIDoGzpYOZxnr5I3UnO/O0lSFmFarP9ouJ SyMLy4zT66IIcgL4dBW+ZfeDkZU6CcYuhTRZaCO9KcnWAF+tHJ4P3giROnyOvYwPr5wpr4xAtu1 mOB/B3+NrztRWM6SitPhI/1xvGIP8kYXgnLKtsib2TGOwHDfb5VydiBoTMo7zuZUj/8e4WRvbyB DXVZR3Or6EMVchjxyo28i55f8= X-Google-Smtp-Source: AGHT+IHeddo7aK4N4dF5dAL9YZGFUNq1dt3cqpyidW1hW09qXjVExMmtBa17hv5VgF/Tid4cEwwr9g== X-Received: by 2002:a05:6512:3ca4:b0:55f:6c5d:759d with SMTP id 2adb3069b0e04-55f709bd940mr3847318e87.49.1756841543205; Tue, 02 Sep 2025 12:32:23 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5608279d0c9sm896107e87.107.2025.09.02.12.32.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Sep 2025 12:32:22 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <86ecspm7ok.fsf@gnu.org> Date: Tue, 2 Sep 2025 21:32:21 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> References: <86ecspm7ok.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79361 Cc: joaotavora@gmail.com, 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 2 sep. 2025 kl. 13.10 skrev Eli Zaretskii : > And yes, it would be nice to have timings. These are obvious improvements at no cost, and JSON performance has = turned out to be important for LSP and similar applications. For what it's worth I've measured the difference that unibyte and binary = coding make on synthetic cases (receiving JSON data and parsing it), not = in eglot, but the improvement seems to be around 30-50 % which is much = better than I expected. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 03 09:04:41 2025 Received: (at 79361) by debbugs.gnu.org; 3 Sep 2025 13:04:41 +0000 Received: from localhost ([127.0.0.1]:39345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utnAH-0000Hw-14 for submit@debbugs.gnu.org; Wed, 03 Sep 2025 09:04:41 -0400 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:57622) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1utnAE-0000Hf-Hr for 79361@debbugs.gnu.org; Wed, 03 Sep 2025 09:04:39 -0400 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-56088927dcbso1535845e87.3 for <79361@debbugs.gnu.org>; Wed, 03 Sep 2025 06:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756904671; x=1757509471; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=hNzj2pj23OvZU7nV87Db9r5Z2os9qsyq+Vr/YGTjH40=; b=OsDVBYfUiBfMAMAsdLXLng5GGxqrODXKzs5FnUx8OLwe//FRsXSAPuaZSu3+gVLN2B s4YkVAW67wPMPWfLjNgy0HAu7IFZuOBP8g6H2bSlxWcSHaiPFsX0zqfEx1LJ1G08sca3 cDoiI/y9SBTDjIumljtbrixAnCvn1klcKXpOZYVXCGnKXCe0ZQUzEH8GiReOh79eWW+A JnKkBlPzO/naB82mBQAM0nejVpsnsvRcZ2q2OePmSW59I/fXjGbqTrV1ZSykAVZRxjQE zst2CQbbNgsXP+5gItOYImQJeRspQwYT+GkDPxlCQ7IgBReZHgjm3CDMD8iR+hVG/I9K zy/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756904671; x=1757509471; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=hNzj2pj23OvZU7nV87Db9r5Z2os9qsyq+Vr/YGTjH40=; b=mOTSTekEJ+2XamgX7kjFEQLX++3mrnPJpLIJ0BmNeEkMNpmRF0LkZA6jsflIkcpDN0 CWLJJnWEOZYOj7WPqJAf3Lz4NFV6ib1pwzwKSKwL6EScqmoCcLghcmFtgG9nu+KmRCIC 6ZCoc4BwIEmjJPZPZkXZ7BfCNI5AO7V0cSNJhsM4+U5/Ta+GD7hLkBe4DvafhS3iExa4 I/5kybnBUJbrfy88rBtYn+a6K95ZNU5LBiKzx8gGutGGksE2u8CTJYCwAqdqupK3r77q //A6A+iIYwxszL/rRwJlI/jzTltVBBZhn7fy0C+VtyDnEGApnkiptmA7IZM+OTuBZSCZ k91A== X-Gm-Message-State: AOJu0YzsUiYQgsbZnFVZ8FRjKrvhCozboWfWoTUA2FPtKW57igXaHlv4 3JFRvGxSZT2J+SmfVNegtyvofvI5oaYzrxmlriplykG+Z5MYGRs77H6O X-Gm-Gg: ASbGncvL8QXYiQLRaVm8C55+c93mQNmo5XXzfagqZXcWLzaHjHwun8E/MIdZJb3/Cmf 4SO0ZNa7DNG5oOqdzoaHDbhneYSzq09/LIjKIJzzWwQIJNBT5y21b1L6AiOZgQg8ymz0cLaqE7w zLzGO99qcRTPYOhGNpOBlhS7RQFgtv2BuJJ753+hHRT+z5/bNt5UgmQiWfjYNKGfqmsIozI11JX w76fIN423Cbj7gS2cDCXr1rm9kdEk7PAeiSRYtYJG8+QauHNxQ7CA5+MWnbSfCPpuz3ClH2rx2H +97GM2qKPRc90lS+yREcTOgDR9HMMNLghKxBPv5riqyvwDSqELlvxTHZIIr4Z1DA+8bahURf6ds cS+NC1uqUsr9Qm4F393ATuIw49llKn2veAIk5KMDib/tCEjM3cfHhARPLZTmlrVYBF9VXp1B3GE sy7TidOPe2qlhW X-Google-Smtp-Source: AGHT+IH0MAcXxgrrZ+NiJvIgGg6795DrlZojBflbokpU69Kk9zUrNPo+Rcv9Selw0oAjyAN7b2/byQ== X-Received: by 2002:a05:6512:32cb:b0:55f:3a07:84a2 with SMTP id 2adb3069b0e04-55f708be8a3mr4772881e87.1.1756904671113; Wed, 03 Sep 2025 06:04:31 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5608ace7e3asm516972e87.88.2025.09.03.06.04.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Sep 2025 06:04:29 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> Date: Wed, 3 Sep 2025 15:04:28 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> To: Eli Zaretskii X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79361 Cc: Daniel Pettersson , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On a more practical note, is there a dedicated maintainer for jsonrpc? I lazily assumed it was Jo=C3=A3o but now see Daniel Pettersson's name = in MAINTAINERS (CC:ed). If there isn't one, or (perhaps equivalently) the answer is the = collective of interested Emacs devs with particular weight given to past = jsonrpc contributors, then I'll just make a more polished patch, test = some more, and push if there are no objections. (For that matter, lsp-mode would benefit from a similar reform and more = but I'll let someone else worry about that. Will be happy to answer = questions though.) From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 03 09:39:18 2025 Received: (at 79361) by debbugs.gnu.org; 3 Sep 2025 13:39:18 +0000 Received: from localhost ([127.0.0.1]:39440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utnhm-0002HL-9G for submit@debbugs.gnu.org; Wed, 03 Sep 2025 09:39:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58232) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1utnhf-0002Gu-S0 for 79361@debbugs.gnu.org; Wed, 03 Sep 2025 09:39:15 -0400 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 1utnhZ-0006S8-Hp; Wed, 03 Sep 2025 09:39:05 -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=dFMGju3DdKkqxt9JqzV+WPUETS55s4BYbdqVEWyv1Zw=; b=fJRjoOEuTHqJjzJgqHfu NUbkrWCWcz5fRxr55zORJbVCgyPJ/QzZ93NXEnlW4dSqBvy7ZRV3IZdoFDEWilNnvtrVd21Q9q5aR 2160yczQgXdrBSxMieE4Y0Fw3rcMV/b1QrVPgHlCvCmdffuQEn7+ZMD1+WSDcuWbheXz73/HVHc8z fTok1av14trhow+Vm+LpShLZeJaXOGiIzBtTOXpWxY8PyjNmDxM+N9J2r3+z++8H+YXc5S5hLUiTM kMxM+dmwxP+KFnwCscnTBvZvpWJ+8rL2f4fMDruy69bf2kV/KT5tQPg1HGKilTQDP7aih/j9oWqIi s0G/zyKm7TaeAA==; Date: Wed, 03 Sep 2025 16:38:58 +0300 Message-Id: <86tt1jk64t.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Wed, 3 Sep 2025 15:04:28 +0200) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79361 Cc: daniel@dpettersson.net, joaotavora@gmail.com, 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Wed, 3 Sep 2025 15:04:28 +0200 > Cc: 79361@debbugs.gnu.org, > João Távora , > Daniel Pettersson > > On a more practical note, is there a dedicated maintainer for jsonrpc? > I lazily assumed it was João but now see Daniel Pettersson's name in MAINTAINERS (CC:ed). > > If there isn't one, or (perhaps equivalently) the answer is the collective of interested Emacs devs with particular weight given to past jsonrpc contributors, then I'll just make a more polished patch, test some more, and push if there are no objections. Let's wait a bit more for João to chime in. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 03 10:33:24 2025 Received: (at 79361) by debbugs.gnu.org; 3 Sep 2025 14:33:24 +0000 Received: from localhost ([127.0.0.1]:40735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1utoY8-0005Ai-22 for submit@debbugs.gnu.org; Wed, 03 Sep 2025 10:33:24 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]:47119) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1utoY5-0005AM-NB for 79361@debbugs.gnu.org; Wed, 03 Sep 2025 10:33:22 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-7454977ccf6so4741601a34.2 for <79361@debbugs.gnu.org>; Wed, 03 Sep 2025 07:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756909995; x=1757514795; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rn0Av9tMDXtvsRLU8VPfeUC94BZvRljTit9Y/a9CYAU=; b=jMj+l21hAaF/5yV6Ovnc5sZDoBIRLBoKpvXBwuxNQVWVNvX4K7OpXMBFh0LAopXCLr jiKiUYbxATULDK3CJgGa05ZXOY+Sk5dlrBMSSmNwB6d5d7N3NM1kE4Typ6vzValnDFdj PCV3Ku3gH+cySP/uCthM7ZugKqDhaX30jjm9LwfueKpcUmQDZ1PbfcAQdAawb0LbSS3M fKkVeKBM5CTwu2U2hJ7lDUHBkxiLkmg1JcpcScFkBPS6ntFYcHc2G5W4tAXeoOgQUO7L u61kkUCWD0W4j+EpgZBdSSzUK5zDJP+iXmNi1TDbzLOsEP4pZ7p+0EK/tzQI1EcEUt5W qb3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756909995; x=1757514795; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rn0Av9tMDXtvsRLU8VPfeUC94BZvRljTit9Y/a9CYAU=; b=HoFIY4qLx7Xw5+xBlwW/Z/69pqDu46WRKybwYHLXMHuTTksx0JNCZ9bVE6LJ4zb9Y3 hzvhcGdRomTPXUgS9o4rH6g83Xj/GX1Mv8WoSCRM6b9JqhHjQKZYPEAkMt/kuAI1xc5x 8Ta5JVb6OUkHFbhHAQnsNruAHScJcx4mROvDs7F7STKNzag6PCnxVNhcLV1edVnrdTo4 Djv/HPfijj0T7rNK8LLo93+aZKupogHecQDvHOafLGaHAhTIzvRyzmmAin4fm/CEk0bN t/lbhPvGFJOEM9MVb5HIdfVX1NmMxWsddLMXjrEbRJfK+lnKTPso9GYV8SQ/DSU+2dg7 QUaQ== X-Forwarded-Encrypted: i=1; AJvYcCXbegNRg8dTbzboC1jrTYdglgGRW1Q9YChuzB096Sf3CuCLs+F7ZnKVD3qZ6y9NxWTGbKxcDA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyGhlSkOpVj9+PsIzW1qkmYps1BHHmLVgYJqUPbTnMZq0UFvqBp +fODFLQ3nADIIdLjUNy40t+p7C0hU+WWPBb6gLdT1XjT00jT3UOUej41fpbOywDqJbmgdMe1WoD G2weY+jc/Vkj0vcF5zeVdJDxB/NXGQbs= X-Gm-Gg: ASbGncvjz6+tQQZQiSccMtdByJ5Le+zE70siAOiidFTLJakwDxejeP97IWvoAFYsYrn S/TSPeWAidD+0AEBiWC28Ba6tHYkIO9Voe680W78MduMjmJqVmcVongCO4Te9Mm01cJRBeETj6I cU213d0WaQtSmeZdsvpdpypIbXRXsIUr31ow8X61HFbg8lglBaKJPj4H8DGxWhJYu526z2CO9Wa iNClJo= X-Google-Smtp-Source: AGHT+IEpBe1TMOx/1yRCEnUigEXc2Ewi0wh3AvnllSBOb88+NCag/rTIph9G8XBJ00kUSl4mxpvoZx3LPlUkNBqK0vw= X-Received: by 2002:a05:6830:700f:b0:745:a0f0:25c6 with SMTP id 46e09a7af769-745a0f030cfmr136095a34.10.1756909995376; Wed, 03 Sep 2025 07:33:15 -0700 (PDT) MIME-Version: 1.0 References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> In-Reply-To: <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Wed, 3 Sep 2025 15:33:04 +0100 X-Gm-Features: Ac12FXyeq-IU7ZLMtEC1I4XGxk2Fy9rED7ROOEmzY8PVN5YIHCGcgMw2TEARkK0 Message-ID: Subject: Re: bug#79361: minor jsonrpc optimisation suggestions To: =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= Content-Type: multipart/alternative; boundary="0000000000002d466d063de67cc6" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79361 Cc: Eli Zaretskii , Daniel Pettersson , 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000002d466d063de67cc6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Sep 3, 2025, 14:04 Mattias Engdeg=C3=A5rd wrote: > On a more practical note, is there a dedicated maintainer for jsonrpc? > I lazily assumed it was Jo=C3=A3o but now see Daniel Pettersson's name in > MAINTAINERS (CC:ed). > Yes, I've handed over maintainership a a while ago. Good call Cc'ing him. > > If there isn't one, or (perhaps equivalently) the answer is the collectiv= e > of interested Emacs devs with particular weight given to past jsonrpc > contributors, then I'll just make a more polished patch, test some more, > and push if there are no objections. > Sounds like a plan. Jo=C3=A3o --0000000000002d466d063de67cc6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Sep 3, 2025, 14:04 Mattias Engde= g=C3=A5rd <mattias.engdeg= ard@gmail.com> wrote:
On a more practical note, is there a dedicated maintainer for = jsonrpc?
I lazily assumed it was Jo=C3=A3o but now see Daniel Pettersson's name = in MAINTAINERS (CC:ed).

<= /div>
Yes, I've handed over maintainership a a while a= go. Good call Cc'ing him.

Sounds like a plan.

Jo=C3=A3o
--0000000000002d466d063de67cc6-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 04 13:29:17 2025 Received: (at 79361) by debbugs.gnu.org; 4 Sep 2025 17:29:17 +0000 Received: from localhost ([127.0.0.1]:49000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uuDlt-0002mJ-AO for submit@debbugs.gnu.org; Thu, 04 Sep 2025 13:29:17 -0400 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:61750) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uuDln-0002lz-3T for 79361@debbugs.gnu.org; Thu, 04 Sep 2025 13:29:12 -0400 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-55f68d7a98aso1329854e87.3 for <79361@debbugs.gnu.org>; Thu, 04 Sep 2025 10:29:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757006944; x=1757611744; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:from:to:cc:subject:date:message-id:reply-to; bh=O5o43zdW0BarLnu/ROwFUWRPt4Z8OYg3GtfQ58QC534=; b=VAg2Tq9rshB54MyDMcJPQyn6Pn4eMRfQty4YVnDeKjg5oqYCb91QtKdnFklXBS76zL 5pENuwzW44+aE2T51EGUNkeMmZsF89HQngJFEzexRLG4m8wKLiEl7rTeGV4qmWDeLImV lBA5Ov4Ieehrrghq/6bF4UB5SMXlSY//68nS1KNbNsBxsFhY89KZDLneBw6D05kMRkIt uKrPkYrNvOfK5IZ08yTnmykSRRe9GyQgeUxLimisV3oBhUciOh6CF6oZiJ2f/EDeHzaz OC5xUgaPGLrzTWRqiwvc4/UQqKSIwP5JrDT4zuSvcF2jn9ov33dZogScxaJ9fAkLRAa7 HdlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757006944; x=1757611744; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=O5o43zdW0BarLnu/ROwFUWRPt4Z8OYg3GtfQ58QC534=; b=U//gdIQ29yVkerptuYeN2Oy2YcvMfeBMj2UOoR78p0zhFonKcjEJpv3e5YqcxziG0A ddsonGrRm8UkuyHsq9NJKD9wBV3hDiaC9LcL/ytWX+18C5BL97VPkMVPHrJhz/2JdBSX 3ihesbKLbS9NCCbWtmHSzeIUWt7ezYdYczDtxEX4bWUx/rT5IXlXzQdQIeB7uF4cp1ga immFo8U8WoBPwfm+/ubUJtG657iniXlDepaZ+iDklzIVdW3QgvkbYxP1mw3cAFQ7uRXz 153g5FFNE2MGrtzY5vzQaGWTBgCyAXNozXKeGKmQ7W+WKou6EXIDt98bpxAOJGdd+G/l bbNQ== X-Forwarded-Encrypted: i=1; AJvYcCV7HNK8pURT2moVTosXhLtqq5BRFPFp+qGW3cZr+kidRFk4cjYOzTke3X9vKRImYemXZRAnbw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yw4hbxWyOfr47ngzNgVC3Azx08NMqajFd1zXNsa/l3nleecWR+o i5QoVuMf0l0LFzrp8KStmxAZ91GuiO5Tf53irtlXcTSP87UMdRWARQYs X-Gm-Gg: ASbGncvdtUv85Rwd61w/pR8shsbbrKXnl54YtxMg3y8zBQwKWtkvVY8Lpc1K23rviJb r0VmrsXaVn/eOs2zvlwFQwiBgeTHftrlZRKA6JCjSLqqeFu9kzRMYDQ/Wc2rADMcRFucfYm+6ns eCRy5euJ4K7i+9zAqdGRdi3QHKoVLQIop0YiKoXzTfNeO5+XHHxoyDhR0cygChQH13mDPfqTXKV R3daCNUvZLwDrgsghrkaNYczP0i+r52M7KOIi9WJCVjGE42Tz08pCtiTOA9RLRf52yUhO7emWKm E/ltaffxPBX3UMk3kYyxFl6JUdYG38Gu53Y+fZbPohj82PRbTIxbphlNWZZDe8hXemUoATTtkUq 5lSrR7MQDxZwdYR9lhUZgeP0nNM1N88UBCIjUVMtjiz8xoacEWJF+dJyJUmB6PHrpk0J/yX9LTY tXIP1jnY24UxlENdHPSXZuC4I= X-Google-Smtp-Source: AGHT+IFqoaSsqBZFh+gYyPz/ZohcE86oeTyyCB0LQXJj2rKwkqmN9QUmLBKy5Sjb8BG91cBRFmTe7g== X-Received: by 2002:a05:6512:239e:b0:55f:53bd:b137 with SMTP id 2adb3069b0e04-55f709060e3mr6993918e87.31.1757006943463; Thu, 04 Sep 2025 10:29:03 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5608abc63c8sm1336573e87.61.2025.09.04.10.29.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Sep 2025 10:29:02 -0700 (PDT) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Message-Id: <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_0BD116E8-F313-4863-98CD-2694B1ED25CF" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions Date: Thu, 4 Sep 2025 19:29:01 +0200 In-Reply-To: To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79361 Cc: Eli Zaretskii , Daniel Pettersson , 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_0BD116E8-F313-4863-98CD-2694B1ED25CF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Here is a proper patch. Tested with a few servers (clangd, = ocaml-lsp-server), and everything seems to work including Unicode in = identifiers and doc strings. --Apple-Mail=_0BD116E8-F313-4863-98CD-2694B1ED25CF Content-Disposition: attachment; filename=0001-Avoid-unnecessary-text-decoding-in-jsonrpc-for-speed.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Avoid-unnecessary-text-decoding-in-jsonrpc-for-speed.patch" Content-Transfer-Encoding: quoted-printable =46rom=20050990b9b972d0214834fb8e9719308721fb2ae5=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Thu,=204=20Sep=202025=2011:22:57=20= +0200=0ASubject:=20[PATCH]=20Avoid=20unnecessary=20text=20decoding=20in=20= jsonrpc=20for=20speed=0A=20(bug#79361)=0A=0AThe=20built-in=20JSON=20= parser=20works=20on=20undecoded=20(unibyte)=20input;=20decoding=0A= received=20data=20is=20just=20a=20waste=20and=20does=20take=20time=20= even=20when=20all-ASCII.=0A=0A*=20lisp/jsonrpc.el=20= (initialize-instance):=20Use=20unibyte=20process=20buffer=20and=0Abinary=20= coding=20for=20process=20I/O,=20implying=20unibyte=20strings=20being=20= passed=20to=0Athe=20filter=20function.=0A(jsonrpc-connection-send):=20= More=20efficient=20message=20generation.=0A(jsonrpc--json-read):=20= Compatibility=20code=20for=20the=20old=20elisp=20json=20parser.=0A= (jsonrpc--process-filter):=20Faster=20header-matching=20regexp.=0A---=0A=20= lisp/jsonrpc.el=20|=2034=20+++++++++++++++++++++-------------=0A=201=20= file=20changed,=2021=20insertions(+),=2013=20deletions(-)=0A=0Adiff=20= --git=20a/lisp/jsonrpc.el=20b/lisp/jsonrpc.el=0Aindex=20= 6c969120926..bb75196cdc8=20100644=0A---=20a/lisp/jsonrpc.el=0A+++=20= b/lisp/jsonrpc.el=0A@@=20-548,7=20+548,9=20@@=20initialize-instance=0A=20= =20=20=20=20(set-process-buffer=20proc=20(get-buffer-create=20(format=20= "=20*%s=20output*"=20name)))=0A=20=20=20=20=20(set-process-filter=20proc=20= #'jsonrpc--process-filter)=0A=20=20=20=20=20(set-process-sentinel=20proc=20= #'jsonrpc--process-sentinel)=0A+=20=20=20=20(set-process-coding-system=20= proc=20'binary=20'binary)=0A=20=20=20=20=20(with-current-buffer=20= (process-buffer=20proc)=0A+=20=20=20=20=20=20(set-buffer-multibyte=20= nil)=0A=20=20=20=20=20=20=20(buffer-disable-undo)=0A=20=20=20=20=20=20=20= (set-marker=20(process-mark=20proc)=20(point-min))=0A=20=20=20=20=20=20=20= (let=20((inhibit-read-only=20t))=0A@@=20-578,16=20+580,11=20@@=20= jsonrpc-connection-send=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(id=20'request)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(method=20'notification)))=0A=20=20=20=20=20=20= =20=20=20=20(converted=20(jsonrpc-convert-to-endpoint=20connection=20= args=20kind))=0A-=20=20=20=20=20=20=20=20=20(json=20= (jsonrpc--json-encode=20converted))=0A-=20=20=20=20=20=20=20=20=20= (headers=0A-=20=20=20=20=20=20=20=20=20=20`(("Content-Length"=20.=20= ,(format=20"%d"=20(string-bytes=20json)))=0A-=20=20=20=20=20=20=20=20=20=20= =20=20;;=20("Content-Type"=20.=20"application/vscode-jsonrpc;=20= charset=3Dutf-8")=0A-=20=20=20=20=20=20=20=20=20=20=20=20)))=0A+=20=20=20= =20=20=20=20=20=20(json=20(jsonrpc--json-encode=20converted)))=0A=20=20=20= =20=20(process-send-string=0A=20=20=20=20=20=20(jsonrpc--process=20= connection)=0A-=20=20=20=20=20(cl-loop=20for=20(header=20.=20value)=20in=20= headers=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20concat=20(concat=20= header=20":=20"=20value=20"\r\n")=20into=20header-section=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20finally=20return=20(format=20"%s\r\n%s"=20= header-section=20json)))=0A+=20=20=20=20=20(concat=20"Content-Length:=20= "=20(number-to-string=20(string-bytes=20json))=20"\r\n"=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20"\r\n"=20json))=0A=20=20=20=20=20= (jsonrpc--event=0A=20=20=20=20=20=20connection=0A=20=20=20=20=20=20= 'client=0A@@=20-641,11=20+638,19=20@@=20'jsonrpc--json-read=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= :false-object=20:json-false))=0A=20=20=20=20=20(require=20'json)=0A=20=20= =20=20=20(defvar=20json-object-type)=0A-=20=20=20=20(declare-function=20= json-read=20"json"=20())=0A+=20=20=20=20(declare-function=20= json-read-from-string=20"json"=20(string))=0A=20=20=20=20=20(lambda=20()=0A= =20=20=20=20=20=20=20(let=20((json-object-type=20'plist))=0A-=20=20=20=20= =20=20=20=20(json-read))))=0A-=20=20"Read=20JSON=20object=20in=20buffer,=20= move=20point=20to=20end=20of=20buffer.")=0A+=20=20=20=20=20=20=20=20;;=20= `json-read'=20can't=20be=20used=20because=20the=20old=20json=20API=20= requires=0A+=20=20=20=20=20=20=20=20;;=20decoded=20input.=0A+=20=20=20=20= =20=20=20=20(prog1=0A+=20=20=20=20=20=20=20=20=20=20=20=20= (json-read-from-string=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20= (decode-coding-string=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (buffer-substring-no-properties=20(point)=20(point-max))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20'utf-8-unix=20t))=0A+=20=20=20=20=20=20=20=20=20= =20(goto-char=20(point-max))))))=0A+=20=20"Read=20JSON=20object=20in=20= (binary=20unibyte)=20buffer=20from=20point.=0A+Move=20point=20to=20end=20= of=20buffer.")=0A=20=0A=20(defalias=20'jsonrpc--json-encode=0A=20=20=20= (if=20(fboundp=20'json-serialize)=0A@@=20-745,8=20+750,11=20@@=20= jsonrpc--process-filter=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20;;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (setq=20expected-bytes=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20(and=20(search-forward-regexp=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= "\\(?:.*:=20.*\r\n\\)*Content-Length:=20\=0A= -*\\([[:digit:]]+\\)\r\n\\(?:.*:=20.*\r\n\\)*\r\n"=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(rx=20= bol=20"Content-Length:=20"=20(group=20(+=20digit))=0A+=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20"\r\n"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(*=20(*=20(not=20(in=20= ":\n")))=20":=20"=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(*=20(not=20(in=20= "\r\n")))=20"\r\n")=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"\r\n")=0A=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(+=20(point)=20100)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20t)=0A=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-number=20(match-string=201))))=0A--=20=0A2.32.0=20(Apple=20= Git-132)=0A=0A= --Apple-Mail=_0BD116E8-F313-4863-98CD-2694B1ED25CF-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 04 16:49:26 2025 Received: (at 79361) by debbugs.gnu.org; 4 Sep 2025 20:49:26 +0000 Received: from localhost ([127.0.0.1]:49441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uuGtZ-00047G-Sa for submit@debbugs.gnu.org; Thu, 04 Sep 2025 16:49:26 -0400 Received: from mail-lf1-f47.google.com ([209.85.167.47]:61762) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uuGtP-00046q-Rl for 79361@debbugs.gnu.org; Thu, 04 Sep 2025 16:49:21 -0400 Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-55f68d7a98aso1545021e87.3 for <79361@debbugs.gnu.org>; Thu, 04 Sep 2025 13:49:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757018948; x=1757623748; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5y4si+RVhuSKDbJYGpfn86j7DYE1mlMXyyLAD7YuapI=; b=JHUGXKwKYMB69DGInLx4LP76t3dGe4IsPhqMXOj6AKG80xREaWwozQxUJMcgzaNWTy rUsWqjzsA/1expCMAbLFcfyZMc/6HGaWgbJhy+76lf9uxlQ0O3OL4eAHbJE9SUxxiA7F rGaJSre8SKIpzhVX7LQJBTFYvRQL6DXNit2uxcRWaPeTmK/kFKmQXfEcz12J/sEAfw3t DYh8mAHP0lj+I7+QZWI/YY/phaoeYF4LVwz4b7Ik9iWEQL7h5yAzLU3QWYKGvRblWPvx C2wbXd6Eiyi3gNraqIF/3j3YdnzZU+qYWSOHhvACKg8+1aax3wo1X8aSeTfP6OSpaImB uUjw== X-Forwarded-Encrypted: i=1; AJvYcCXlE0+/1OKXqcdjf34QW1bE7jZWebz2M3TgbQpzZlv6gacmyJ1kbMmfBnfPlhm207Ed3GZHFw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwhQgAMxjC281wTeQ/FcsmhcPftLixvjo8FsWuxeKtsT39WaDR9 0lFDhuQ22Qkfw8wYZqSTAmtLXQ5AY9TbJwqJ4Co63w9v3wVzWEKQEKwJSwxU5A== X-Gm-Gg: ASbGncs+/kS7STvwiq5NUYoBXfUKqUoEYnGyXN9SnQAbcrMY+J6OuSNG0zaxTdePHSk bkYWM9HdMS26MH+q6nwyqhsDL7Rfj7+3Xz5A01keg1K15ck1mqJhwgCZQ04XZisIq2IxhcVDr/I 0G8M73vr1qfiJOVrdXT5ikP6cthM3YRls2gh7yiq+HkQzXZUaeCprwDq2afaAuynJLYLRuxwxbd klWXQT/WTvxLIMuUzWkon6pPXR89OktM6eYdJeKpMBRsvarrEgPCzCWRX4Y+RU+uzHjGIzlRs1s E9UDn44yInbLoz3KNfdR/aKeu0zyImq+nXThZMFROADeqJQCc8V2/JyQMwetuX2rDrzqwdFhykU zOvgzi8ghMWv23xAen3jGN8fgyhjdEq/yjm4Vj5GcpkQ40hMTylxPBgTLQVPgifzVg8O0G8/s X-Google-Smtp-Source: AGHT+IEhSUSAsxt2eWej1aPCzXBWNvQXJyCVzASNxUNJn3IDDcqGI2SFz33FOcWk5l0NHyV/sJZYOA== X-Received: by 2002:a05:6512:1093:b0:55f:4dbe:1c72 with SMTP id 2adb3069b0e04-55f7099d3c0mr6270195e87.53.1757018947847; Thu, 04 Sep 2025 13:49:07 -0700 (PDT) Received: from MacBookAir (c-85-228-201-151.bbcust.telenor.se. [85.228.201.151]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5608ad4d3efsm1401525e87.146.2025.09.04.13.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Sep 2025 13:49:07 -0700 (PDT) From: Daniel Pettersson To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Subject: Re: bug#79361: minor jsonrpc optimisation suggestions In-Reply-To: <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> Date: Thu, 04 Sep 2025 22:49:06 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79361 Cc: Eli Zaretskii , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Mattias Engdeg=C3=A5rd writes: > Here is a proper patch. Tested with a few servers (clangd, > ocaml-lsp-server), and everything seems to work including Unicode in > identifiers and doc strings. Tested with eglot and dape. It feels snappier and unicodes are still live. This is great! Daniel From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 05 02:39:22 2025 Received: (at 79361) by debbugs.gnu.org; 5 Sep 2025 06:39:23 +0000 Received: from localhost ([127.0.0.1]:50676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uuQ6R-0002hR-SF for submit@debbugs.gnu.org; Fri, 05 Sep 2025 02:39:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53362) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uuQ6M-0002fe-4k for 79361@debbugs.gnu.org; Fri, 05 Sep 2025 02:39:17 -0400 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 1uuQ6F-0007RA-8H; Fri, 05 Sep 2025 02:39:07 -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=t+nox9k0ZwbXsweTYqIWffgN7t3GfXi3fkDBzXasn+w=; b=kJ1hdZZHfcE7nnmD2HOS 7BfjsN1hD/jd5Lm4ksZu1C1RH3aZE/hU57c1KJUVvd0BQixVhqvnonX+Uvr+L/jjbyhlT7BSZbdU4 qzpdryIJOMKJUeo1tuEJbCC+SIDjs5S8hG9qQ0tkbd/nirol7UP7gl8s2EYQdcKNCQow8WWrthv+8 9JfkGivQx9/XrMJJXB3B5Ule7zklmEymA2SKgt6U/H4TtZ2FuCG/xtN/V5LOCOu/VDKiTbYdnA9mH mBdGf5S36T4Flw5xzphSQD2AL38Ce80OTRWqNgdFTGIG8AdkGt7DkJTWL5bYxgUSlMBb+NogJsWn8 JrPPIc13remFBQ==; Date: Fri, 05 Sep 2025 09:39:02 +0300 Message-Id: <86qzwliet5.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= In-Reply-To: <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Thu, 4 Sep 2025 19:29:01 +0200) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79361 Cc: daniel@dpettersson.net, joaotavora@gmail.com, 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Thu, 4 Sep 2025 19:29:01 +0200 > Cc: Eli Zaretskii , > 79361@debbugs.gnu.org, > Daniel Pettersson > > Here is a proper patch. Tested with a few servers (clangd, ocaml-lsp-server), and everything seems to work including Unicode in identifiers and doc strings. Thanks. Can this change affect programs using jsonrpc in any way? For example, do we have hooks or user-defined functions that can be called with this buffer the current buffer? If so, this change should be called out in NEWS, because now the buffer is unibyte and the text in it is undecoded. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 05 04:45:55 2025 Received: (at 79361) by debbugs.gnu.org; 5 Sep 2025 08:45:55 +0000 Received: from localhost ([127.0.0.1]:51164 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uuS4x-0001tb-1x for submit@debbugs.gnu.org; Fri, 05 Sep 2025 04:45:55 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]:55798) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uuS4t-0001tF-3F for 79361@debbugs.gnu.org; Fri, 05 Sep 2025 04:45:52 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-336af6356a5so15205851fa.3 for <79361@debbugs.gnu.org>; Fri, 05 Sep 2025 01:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757061944; x=1757666744; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=CAIj/1IzZMm4eTWlZtbDcIi8r5biAgZdtNIgKk91iew=; b=A38cA8AEz1IT7JyvRJDdMx4mgaJBBat+Jlm+/Jadv0jWKXP3SFzrJ0TO6g04M8ZobE OUOsp2X5jJoqgG4IWvNJ0mdgYYlzfdGkrWFAG3Ogd5RWqm31c41jFgZvmAPV9WE6/ULS Pt0JwH6cCW2fbqNtXnpJY2QhgRwhf5eWLq+Pix6JG+KhuCPYY7uN9SaUHwsSWpi8Gmue yuDeTYs/hVPVZko1g3uXAZWiwceeeZuGZHTqeKZAgNiKfTSCpfbXfIYDh3pYxYBtoiA6 cOI8Cl6Bv40ZiGi/EIuIev1WcpJmdM8PuGIvUgVzYbPBoyGHq4cCR6BgTwUGQlyGPbxi Sc3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757061944; x=1757666744; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=CAIj/1IzZMm4eTWlZtbDcIi8r5biAgZdtNIgKk91iew=; b=Iaae4P10tlNUzTTFTxNgEM9KKvoE0drH/KsIQ9npM22+/DU+se8BzW8vMBrvkEPO5W Ca+3TPMfs4ZxggAgEZLTKX58ycbrP1+CrisbjypWvKGAgmw6S+0Luv7ktPJ7XhBh6EpO NDtYIbvqshXj4kJHOUk+ruGCnBcPZYoueP3ZAozF6pda/OLCOYbFSVgzwQnnsjp++ofS GC7u0jLvLSyo0wH1YMYn5yFekaq8PF+ktR439tJcJ8amXqHie593EMG7ytIs9CByKomK WvFXNIQzyYq8j7OHUhf4j1HbmN9enDhVb2/o1RLAipFrBsCioa0iNtrb4rGXwyvpmWCD UowA== X-Forwarded-Encrypted: i=1; AJvYcCW7mrQPruRJcHxBIXAKi5L4p3hgwKEc80NhmXU+fbj7OIyQw9QWTx75V1dqOz90ZvRf0fXYAw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yx7iuUqdfalahjJ4AguvpAILOm/xpJcZIN1jJlTODXTwFMCJcAr nNfXHYlBR6CPwSVALbmJsUh8a1psvdVeJ1NgUIlZyjg8eY1P9asRiqdU X-Gm-Gg: ASbGncs7tTnegXnNMvalanCXgDg9n573xttBVRkoBww6Oyl/030Cc+A+ReAv3Mkroy/ eeAAFuyL2lZ0/+hY21XbO1uha+eQKwLxaOenwSlhX+mZSksdgwTzvZEgr2Ffj0alKZpdvQPAiiS 4sKudZ02D0NcQuKucfYgHrJITo93CyddA4oBGrHt9pG+U20GtBmqsozlP9nScuMWLktapsjLAEs h01XQTRGlv9u2YZ7rngPJhOJpiI0RMfEvO66u3oihx+c4AVHYmfO7IjkuTIe33Uiq0STuXnRZFH GK1sMXz4F4neNTuWYWt7IJsS5BH/3JoHWd4zyuO3TQNST2jWcLlS+k9wsM6LcraC5hiZVdBOMTn uO4NoZkqK+Pba+LP+TVXu1Zn6gnQYZmFfZ96CJKQ0jKezoq0fqFFPNmJev+rT1fn1Le4i7taIFD KMZv0goKdcEgssmgDB7KYRtes= X-Google-Smtp-Source: AGHT+IEDjSXJjBRTi+5m9fjP04+r4J9AtFRx8oU/zwP4WlKWH9G5LoUx2mJQnvoDOUBXPE7GldVWzQ== X-Received: by 2002:a05:651c:1a0c:b0:336:cce2:fa5d with SMTP id 38308e7fff4ca-336cce30084mr79138871fa.11.1757061943878; Fri, 05 Sep 2025 01:45:43 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-337f5077055sm18665821fa.49.2025.09.05.01.45.43 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Sep 2025 01:45:43 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= In-Reply-To: <86qzwliet5.fsf@gnu.org> Date: Fri, 5 Sep 2025 10:45:42 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> <86qzwliet5.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79361 Cc: daniel@dpettersson.net, joaotavora@gmail.com, 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 5 sep. 2025 kl. 08.39 skrev Eli Zaretskii : > Can this change affect programs using jsonrpc in any way? For > example, do we have hooks or user-defined functions that can be called > with this buffer the current buffer? I don't think so, because jsonrpc creates that buffer itself and treats = it entirely as its own property. Its name starts with a space, making it = internal. There should be no user-visible changes. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 05 06:48:53 2025 Received: (at 79361) by debbugs.gnu.org; 5 Sep 2025 10:48:54 +0000 Received: from localhost ([127.0.0.1]:51969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uuTzx-0001VL-Hd for submit@debbugs.gnu.org; Fri, 05 Sep 2025 06:48:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36648) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uuTzu-0001V1-SU for 79361@debbugs.gnu.org; Fri, 05 Sep 2025 06:48:51 -0400 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 1uuTzo-0007IC-Oc; Fri, 05 Sep 2025 06:48:44 -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=gg+nkhfQ3qF9YhnRENqGce/ynLkT7OrbnXACMSj6Vw8=; b=N0dd+ggqq7mspPoN1LTH Jj5zgiIT6WTgWbYWlU5lPaf8vbd8jDS1XErhT8ZBsBUU/7KOGVp1CXHqjoRvBQHxVz7F2VTP0ktDt MtCOM5URP+uYCN+ulCu3XPi9CFiyuF9uf1zWUsBMvWddWSqvUuT3dSMd1ML8ThpV9DVrZNVAO1gq9 UnRw4DBfmJHBmk7qtuxKTj7CsUuXEwGkktF7T9a9blYJQg1iRUmgKoQsfXlT94fbnU+PuuhPd1N7D gnONrixCmQNPtpwp56A4bxKkxuacJCEvLKcCMbIERPcE7YdzpZfCsJG5irvKLDvUpFKROlFZz6b9F Iaw4qWAKYOhwiQ==; Date: Fri, 05 Sep 2025 13:48:39 +0300 Message-Id: <86ms79i394.fsf@gnu.org> From: Eli Zaretskii To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= , daniel@dpettersson.net In-Reply-To: (message from Mattias =?utf-8?Q?Engdeg=C3=A5rd?= on Fri, 5 Sep 2025 10:45:42 +0200) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> <86qzwliet5.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79361 Cc: joaotavora@gmail.com, 79361@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Mattias Engdegård > Date: Fri, 5 Sep 2025 10:45:42 +0200 > Cc: joaotavora@gmail.com, > 79361@debbugs.gnu.org, > daniel@dpettersson.net > > 5 sep. 2025 kl. 08.39 skrev Eli Zaretskii : > > > Can this change affect programs using jsonrpc in any way? For > > example, do we have hooks or user-defined functions that can be called > > with this buffer the current buffer? > > I don't think so, because jsonrpc creates that buffer itself and treats it entirely as its own property. Its name starts with a space, making it internal. There should be no user-visible changes. What about jsonrpc-event-hook? It runs in the buffer returned by jsonrpc-events-buffer -- is that affected by these changes? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 05 11:16:34 2025 Received: (at 79361) by debbugs.gnu.org; 5 Sep 2025 15:16:34 +0000 Received: from localhost ([127.0.0.1]:55691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uuYB0-0003zJ-4Z for submit@debbugs.gnu.org; Fri, 05 Sep 2025 11:16:34 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:46239) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uuYAv-0003yr-K9 for 79361@debbugs.gnu.org; Fri, 05 Sep 2025 11:16:31 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-336e44ca0e4so18695851fa.0 for <79361@debbugs.gnu.org>; Fri, 05 Sep 2025 08:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757085382; x=1757690182; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:from:to:cc:subject:date:message-id:reply-to; bh=6JH4tv5B4IEh3PhaX+EsxF0JXtoCHBi0BKTsAG5c5XU=; b=JkZ5t2yGm1V5Y6RvD8lbbB566qVKwoii/oZmcOGd45V0NKbRLZfiMnU11Ab2kgugvR DsKuYIroKT9m9eV1030wmvpUhFfZHughnldq1hjJ95K4n3v3IwuCDfqzaMqImRRV3e7B 2cHJRcRhd3+xXj6kMsL40ecB/RoChBVTrBXiFJR6JslE/Ki/DRsokeBGP0Us7A57wksW 2zdpecceGGKZo0yOw0ZqTsICh72RD+zHY4+PlKC/ZnWJPN96uRzYl5MEaI/f8Gk2oT3R NU/9j8CJndX8Q+YueY4NR/nt7KSATki4+lKNd+9Uyu36n6qKXVBJoPWy1AXp8OzacXbd RQ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757085382; x=1757690182; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6JH4tv5B4IEh3PhaX+EsxF0JXtoCHBi0BKTsAG5c5XU=; b=eS+IcN0VOfQp+2bZ2KC+wYx2yzBpX36tQ3+LuPPSbdz1qD+dg4jHugqLYADZDr0sia vDS0ov2xp+y/miS2QFTS0j7aaYA6FCLEnR2EvOMqJ33XIsMcThGLvsuaxObVgDcg3lVi qx/EPwwTtsU8XgJo9bGEiOFwE49yBHm8WQH3f07FHu5s8khwSo0oIDS9VO0vhRDtFrJ3 8FjqOIbYx2OC342XSz0xnCk6LYw63pCwhsxqfy8hYIdvJdfTwyvLGtgoT0elkTKZA6Qs umkiX2ANdOxQF91C5TYJJwLsON4am+jDZntnBKCVlsPVNeHwjAjIZ6T/AzqEVDP8Viqz vrEA== X-Forwarded-Encrypted: i=1; AJvYcCX9ec97mp2WYSex4h2W10/t7mmeleRiZYtxrDj8S5bCEk/KjTNF1aDjVZ2RvzAumLCQfbKmMw==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywy7ahAnl0IGbSiBujW75iXcQlyIhUharuxYyYKoPa++pnoihYE asci7k1DBI6YVTobuise1rGS4SW7sdgEbcHs+t/ppECWWfcxyKoUBQEB X-Gm-Gg: ASbGncv5YQfQaGykRL/9CNLRKvw14N1Pl0gTZEvYyA/xUesv9ZOanI6GJgiTb7C5dw/ 3HFbfIf5s8+xVj+vfgxiv8iSouuZXGr+SGxALtx+UizgTTKiIHpcDtdG5XFwbW91YnREtKF4GT8 C/x81/HTSyWkV43p+Si/9xkQ7vyzvosQiuKIrqh8TOwmBuFFqORgAghviCKGubNnQyX8Mei4UV+ EMBUXGcoaBCPH/SFFyHjpLBlvMR88wajtWOV7rBCZ54jxORPG77eONZ9rlbYgG7ZTbfLMs4qOGx KK1Hjb2OYkeU5fTOutYQPb5RcYUzKM3+5cBkm1EKDu0FBvUfsxfo1yj5nJ31WF6RB8ZqWZhWaeH TXOpu6YH5PFsmbjt2x01jKYTk2AuFAKSv0NJ8gL4UO49B1N+kvIpSc9nV9pBhTl4BMagHJ2178g YJO1Q03KcsU1Xd X-Google-Smtp-Source: AGHT+IFE2j1QaOgE3QDKcu0sGbCRZqr+QKqm9jIjd3JVX4T0BHLxLf+qG9UJ5tvSTOXEBrzBrgWcnw== X-Received: by 2002:a05:651c:23c8:10b0:337:e190:6814 with SMTP id 38308e7fff4ca-337e1906f45mr50642751fa.20.1757085382175; Fri, 05 Sep 2025 08:16:22 -0700 (PDT) Received: from smtpclient.apple (c188-150-186-155.bredband.tele2.se. [188.150.186.155]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-337f50a263esm19286601fa.55.2025.09.05.08.16.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Sep 2025 08:16:21 -0700 (PDT) From: =?utf-8?Q?Mattias_Engdeg=C3=A5rd?= Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_8C244C79-376C-48D3-B0D1-80A40F2A6063" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Subject: Re: bug#79361: minor jsonrpc optimisation suggestions Date: Fri, 5 Sep 2025 17:16:20 +0200 In-Reply-To: <86ms79i394.fsf@gnu.org> To: Eli Zaretskii References: <86ecspm7ok.fsf@gnu.org> <87B001DA-35B2-4358-AA50-2DDF94DCC388@gmail.com> <9E935C8B-0E9A-4F78-96CE-F3EFD71280D1@gmail.com> <15AEC23F-F42A-44A5-A531-635B84732535@gmail.com> <86qzwliet5.fsf@gnu.org> <86ms79i394.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.15) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79361 Cc: 79361@debbugs.gnu.org, daniel@dpettersson.net, joaotavora@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_8C244C79-376C-48D3-B0D1-80A40F2A6063 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 5 sep. 2025 kl. 12.48 skrev Eli Zaretskii : > What about jsonrpc-event-hook? It runs in the buffer returned by > jsonrpc-events-buffer -- is that affected by these changes? No, that buffer is not affected. It's a pure text buffer, used as a = debug log. However, this made me look at that events buffer. It does seem that = eglot and/or jsonrpc logs way too much. It seems unlikely that this = wouldn't affect performance. Although the user can turn off much of it = (setting :size in `eglot-events-buffer-config` to 0), this should = probably be the default. In fact, the way eglot keeps the events buffer below its maximum size = isn't wonderful either: 1076 (save-excursion 1077 (goto-char (point-min)) 1078 (while (> (buffer-size) max) 1079 (delete-region (point) (progn (forward-line 1) 1080 (forward-sexp 1) 1081 (forward-line 2) 1082 (point))))))))))) So it deletes a small chunk at the very beginning of the buffer. Surely = that will ping-pong the gap between the beginning and the end of the = buffer every couple of logged items, ie a memmove of all the contents = each time? We could do better here. What about changing this to chopping off a constant proportion of the = buffer instead, say 1/3? At least that gives an amortised cost that is = independent of the buffer size. It doesn't help with the occasional = latency spike though, so again, the default events buffer :size should = probably be 0; formatting log items is also costly. Proposed patch = attached. However, even with the :size set to 0, we still get forwarded messages = from the stderr buffer in the events buffer, and some language servers = seem to be quite chatty. These log entries do not honour the max buffer = size at all, which is probably a bug. I didn't do anything about that. --Apple-Mail=_8C244C79-376C-48D3-B0D1-80A40F2A6063 Content-Disposition: attachment; filename=0001-Less-expensive-jsonrpc-and-eglot-logging-bug-79361.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Less-expensive-jsonrpc-and-eglot-logging-bug-79361.patch" Content-Transfer-Encoding: quoted-printable =46rom=20fb3346138e673e78fd8f3e470eaa97b57ebe3a48=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Mattias=3D20Engdeg=3DC3=3DA5rd?=3D=20= =0ADate:=20Fri,=205=20Sep=202025=2016:40:06=20= +0200=0ASubject:=20[PATCH]=20Less=20expensive=20jsonrpc=20and=20eglot=20= logging=20(bug#79361)=0A=0AThe=20events=20logging=20is=20surprisingly=20= expensive=20so=20we=20turn=20it=20off=20by=0Adefault=20and=20make=20it=20= somewhat=20less=20costly=20when=20enabled.=0A=0A*=20lisp/jsonrpc.el=20= (jsonrpc--log-event):=20Remove=20the=20oldest=201/4=20of=20the=0Abuffer=20= when=20reaching=20the=20size=20limit=20instead=20of=20just=20a=20few=20= lines.=0AThis=20improves=20the=20cost=20of=20adding=20a=20log=20entry=20= from=20O(buffer-size)=20to=20O(1).=0A*=20lisp/progmodes/eglot.el=20= (eglot-events-buffer-config):=0AChange=20the=20default=20events=20buffer=20= size=20to=200.=0A*=20etc/EGLOT-NEWS:=20Announce.=0A---=0A=20= etc/EGLOT-NEWS=20=20=20=20=20=20=20=20=20=20|=20=205=20+++++=0A=20= lisp/jsonrpc.el=20=20=20=20=20=20=20=20=20|=2015=20++++++++-------=0A=20= lisp/progmodes/eglot.el=20|=20=202=20+-=0A=203=20files=20changed,=2014=20= insertions(+),=208=20deletions(-)=0A=0Adiff=20--git=20a/etc/EGLOT-NEWS=20= b/etc/EGLOT-NEWS=0Aindex=206505a6d8567..cf1c1100d84=20100644=0A---=20= a/etc/EGLOT-NEWS=0A+++=20b/etc/EGLOT-NEWS=0A@@=20-54,6=20+54,11=20@@=20= by=20the=20LSP=20server=20pertain.=20=20This=20helps=20in=20skipping=20= useless=20or=20harmful=0A=20updates,=20avoiding=20flakiness=20with=20= code=20actions=20and=20flickering=20overlays=0A=20when=20the=20buffer=20= is=20changed.=0A=20=0A+**=20Events=20logging=20is=20off=20by=20default=20= (bug#79361)=0A+The=20default=20value=20of=20the=20':size'=20parameter=20= in=20'eglot-events-buffer-config'=0A+user=20option=20is=20now=200=20(was=20= 2000000).=20=20Set=20it=20to=20a=20size=20of=20your=20choice=20if=0A+you=20= need=20to=20debug=20Eglot,=20a=20language=20server=20or=20your=20= configuration.=0A+=0A=20=0C=0A=20*=20Changes=20in=20Eglot=201.18=20= (20/1/2025)=0A=20=0Adiff=20--git=20a/lisp/jsonrpc.el=20b/lisp/jsonrpc.el=0A= index=20bb75196cdc8..3bfca01abfb=20100644=0A---=20a/lisp/jsonrpc.el=0A= +++=20b/lisp/jsonrpc.el=0A@@=20-1073,13=20+1073,14=20@@=20= jsonrpc--log-event=0A=20=20=20=20=20=20=20=20=20=20=20= (insert-before-markers=20msg)=0A=20=20=20=20=20=20=20=20=20=20=20;;=20= Trim=20the=20buffer=20if=20it's=20too=20large=0A=20=20=20=20=20=20=20=20=20= =20=20(when=20max=0A-=20=20=20=20=20=20=20=20=20=20=20=20(save-excursion=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20(goto-char=20(point-min))=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(while=20(>=20(buffer-size)=20= max)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(delete-region=20= (point)=20(progn=20(forward-line=201)=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(forward-sexp=201)=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(forward-line=202)=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(point)))))))))))=0A= +=20=20=20=20=20=20=20=20=20=20=20=20(while=20(>=20(buffer-size)=20max)=0A= +=20=20=20=20=20=20=20=20=20=20=20=20=20=20(delete-region=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(point-min)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(save-excursion=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20;;=20Remove=201/4,=20to=20keep=20insertion=20O(1)=20= amortised.=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (goto-char=20(+=20(point-min)=20(/=20(buffer-size)=204)))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(forward-line)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20(point))))))))))=0A=20=0A=20(defun=20= jsonrpc--forwarding-buffer=20(name=20prefix=20conn)=0A=20=20=20"Helper=20= for=20`jsonrpc-process-connection'=20helpers.=0Adiff=20--git=20= a/lisp/progmodes/eglot.el=20b/lisp/progmodes/eglot.el=0Aindex=20= d06b97b431e..b00742a2426=20100644=0A---=20a/lisp/progmodes/eglot.el=0A= +++=20b/lisp/progmodes/eglot.el=0A@@=20-466,7=20+466,7=20@@=20= eglot-send-changes-idle-time=0A=20=20=20:type=20'number)=0A=20=0A=20= (defcustom=20eglot-events-buffer-config=0A-=20=20(list=20:size=20(or=20= (bound-and-true-p=20eglot-events-buffer-size)=202000000)=0A+=20=20(list=20= :size=20(or=20(bound-and-true-p=20eglot-events-buffer-size)=200)=0A=20=20= =20=20=20=20=20=20=20:format=20'full)=0A=20=20=20"Configure=20the=20= Eglot=20events=20buffer.=0A=20=0A--=20=0A2.32.0=20(Apple=20Git-132)=0A=0A= --Apple-Mail=_8C244C79-376C-48D3-B0D1-80A40F2A6063--