From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: [PATCH] Jsonrpc: improve performance of process filter function Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Feb 2024 18:25:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 69241@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170828070313347 (code B ref -1); Sun, 18 Feb 2024 18:25:07 +0000 Received: (at submit) by debbugs.gnu.org; 18 Feb 2024 18:25:03 +0000 Received: from localhost ([127.0.0.1]:37429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblqZ-0003Sy-45 for submit@debbugs.gnu.org; Sun, 18 Feb 2024 13:25:03 -0500 Received: from lists.gnu.org ([209.51.188.17]:44974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblNj-0001bb-T0 for submit@debbugs.gnu.org; Sun, 18 Feb 2024 12:55:16 -0500 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 1rbWMd-00087O-9H for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 20:53:07 -0500 Received: from mail-lj1-f174.google.com ([209.85.208.174]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbWMa-0006zc-U4 for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 20:53:06 -0500 Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2d10ad265d5so27777661fa.0 for ; Sat, 17 Feb 2024 17:53:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708221182; x=1708825982; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=A1iDhSOPUhTKsXKHlUuLnJ2UCro9NsKfr5qT66UqHO8=; b=sj42aG/rIasHCIkk7onH/GLgZk8U6RAzFHTFUSqqtYDKlu9EsphM7lmxWoI5qh/+c/ iy4XoBZW3M7fNYg6UjnTu4nw9x3as9fG0Ugjqm8BUisAAUIagN7vtvdGtYlSBv9M2tfK EEju6zV+l/ZpyoZPRlnor3FXgLYrYHfE3oO3NLx+3vboFUWgrdoQJHrBaFhAXZUnfsmM ZbR+g4W38B+PAVO9lN0lOrsC5uOfvOaEzApAJuZf+kG5YJzqRl8mq8HfT6KDgGfbdUiw loQ4DAVPu3o/2oprkub3d1RGOp/H5TjdKOtMDqM6SZ7+pFgQSm2KXXA+sMGSIGvWFj2Q f58Q== X-Gm-Message-State: AOJu0Yz+Cvcuiz1uhd1nlTVQXXUDPA6OK0TyuncoXUZD1tMXAPSda1VT NzuY5IYwHVtkGnmEcWAHtiVR+o1+rXtAxzPBdqzdYYhDyEVClFSYaOhDBNyb X-Google-Smtp-Source: AGHT+IHBFgJyX6OIJgTaoMXCxR1e2c0DTflOIXhwBFZvShveM9chgl1DJvjBpa5Wijalq0gu1VUhoQ== X-Received: by 2002:a2e:9217:0:b0:2d0:dfa6:2b3f with SMTP id k23-20020a2e9217000000b002d0dfa62b3fmr6509093ljg.1.1708221182368; Sat, 17 Feb 2024 17:53:02 -0800 (PST) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id v8-20020a2e9248000000b002d06c31cf6esm506104ljg.124.2024.02.17.17.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 17:53:01 -0800 (PST) From: Daniel Pettersson Date: Sun, 18 Feb 2024 02:53:01 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=209.85.208.174; envelope-from=daniel.dpettersson.net@gmail.com; helo=mail-lj1-f174.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -3.3 (---) 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: -4.3 (----) --=-=-= Content-Type: text/plain Tags: patch This was issue was discovered during elpa package dape's development, where an adapter was sending 72000 notifications on startup which leads to emacs looping over timer--time-less-p for > 50 seconds and after the fix for less then 1 second. The "integrity" of timer order are messed with but as timer_check runs all of the ripe timers in the same while loop it only becomes an question of execution order. This change uses timer.el internal api `timer--triggered', but this might be fine as it's tightly coupled with keyboard. In GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.1.0, NS appkit-2487.20 Version 14.1.1 (Build 23B81)) of 2023-12-20 built on Daniels-Air Repository revision: 281be72422f42fcc84d43f50723a3e91b7d03cbc Repository branch: master Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14.1.1 --=-=-= Content-Type: text/patch; charset=utf-8 Content-Disposition: attachment; filename=0001-Jsonrpc-improve-performance-of-process-filter-functi.patch Content-Transfer-Encoding: quoted-printable >From 92eef1a5221dd69dc95a9484eafeacad571246f8 Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Sun, 18 Feb 2024 02:05:46 +0100 Subject: [PATCH] Jsonrpc: improve performance of process filter function `run-at-time' keeps `timer-list' list sorted by inserting each timer based on the timer value. This means that `timer--time-less-p' needs is executed ~ N*N/2 times for each N pending messages. This means that jsonrpc becomes unusable for connections that generate a lot messages at the same time. * lisp/jsonrpc.el (Version): Bump to 1.0.25 (jsonrpc--process-filter): Improve performance --- lisp/jsonrpc.el | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 14fe0447008..9a52b5a76cf 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ =20 ;; Author: Jo=C3=A3o T=C3=A1vora ;; Keywords: processes, languages, extensions -;; Version: 1.0.24 +;; Version: 1.0.25 ;; Package-Requires: ((emacs "25.2")) =20 ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -782,11 +782,22 @@ jsonrpc--process-filter ;; non-locally (typically the reply to a request), so do ;; this all this processing in top-level loops timer. (cl-loop + with time =3D (timer-relative-time nil 0) for msg =3D (pop (process-get proc 'jsonrpc-mqueue)) while msg - do (run-at-time 0 nil - (lambda (m) (with-temp-buffer - (jsonrpc-connection-receive conn = m))) - msg))))))) + do (let ((timer (timer-create))) + (timer-set-time timer time) + (timer-set-function timer + (lambda (conn msg) + (with-temp-buffer + (jsonrpc-connection-receive conn m= sg))) + (list conn msg)) + (setf (timer--triggered timer) nil) + ;; We're bypassing `timer-activate' due to performance + ;; concerns. `timer-activate' iterates through all + ;; timers scheduled to execute before inserting our + ;; callback. While it doesn't maintain the precise + ;; order of timers, we should be fine. + (setf timer-list (cons timer timer-list))))))))) =20 (defun jsonrpc--remove (conn id &optional deferred-spec) "Cancel CONN's continuations for ID, including its timer, if it exists. --=20 2.39.3 (Apple Git-145) --=-=-=-- From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues References: In-Reply-To: Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Feb 2024 12:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 69241@debbugs.gnu.org Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.17091230083739 (code B ref 69241); Wed, 28 Feb 2024 12:24:02 +0000 Received: (at 69241) by debbugs.gnu.org; 28 Feb 2024 12:23:28 +0000 Received: from localhost ([127.0.0.1]:35596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfIy7-0000yC-QN for submit@debbugs.gnu.org; Wed, 28 Feb 2024 07:23:28 -0500 Received: from mail-lf1-f48.google.com ([209.85.167.48]:56616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rfIy5-0000xg-Kp for 69241@debbugs.gnu.org; Wed, 28 Feb 2024 07:23:26 -0500 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-512e568607aso5540216e87.1 for <69241@debbugs.gnu.org>; Wed, 28 Feb 2024 04:22:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709122973; x=1709727773; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0n9TbP3WnNHz1wWeX5SaoZQZQIxoTw02hOiSGakuhow=; b=sHWGkSPJVjqGqNF7o/sBbJa5hnqAEd1n0jYiV+iloLSMMtWN67FY5Q4b+V/jPJiKow YdnlCWpuRPssnhEi0+xCHfn1AnjxSr4DLw1tlFb8otQeX6G+ka3NDaj608HvlsWmSGQx GZqEEhAfa4+lETpiA1xkgtqclPFnAsJVy2Y3U49PDvFYiyvJmNVmg93RRPQlm1lF/zIO xyV78w+UXXpZaFV+H5XhRQdfgkEqROeAiH4m0yfVqC/ZGKktPeEasYCRW5Y/e5vrEy3V MjRUbm9G3HBeolB3gwaLtbOfxbp8icNfCU24vHZJBo7ikHRp4r3tRy0p5hs2cGpH6n60 5lEg== X-Gm-Message-State: AOJu0Yyy0bgGGEbCj62YSvtZRWt2GlKHjuFKBf6SQzWyjNazoKxzyFnR 3mcNFM9e9rVYF3RqzyMn/ysIEmX+LHGFL1EEeIGk9DxwNFiipZarrdB4srZr X-Google-Smtp-Source: AGHT+IHVWpS4sQfEj1QGKC68bywCB4errb6wIVLlETQqwgAJ5A5iNmYZ0VVQOB6KVypGdVnRRrPkCw== X-Received: by 2002:a05:6512:114c:b0:512:e506:1c66 with SMTP id m12-20020a056512114c00b00512e5061c66mr10225530lfg.26.1709122972355; Wed, 28 Feb 2024 04:22:52 -0800 (PST) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id h21-20020a19ca55000000b005131149642fsm487787lfj.34.2024.02.28.04.22.51 for <69241@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 04:22:51 -0800 (PST) From: Daniel Pettersson Date: Wed, 28 Feb 2024 13:22:50 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.2 (/) 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.8 (/) --=-=-= Content-Type: text/plain The previous patch included an large regression, where "batch" of messages where handled as an LIFO. This patch should fix the issue and also removes the dependency on timer.el internal apis. Which makes it instead dependent on undocumented behavior that timers of equal time are executed in LIFO order. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Jsonrpc-improve-performance-of-process-filter-functi.patch Content-Transfer-Encoding: quoted-printable Content-Description: patch >From c4d5ddb9ce5cdb8c283928daf6b166e4ce5a430d Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Wed, 28 Feb 2024 13:03:56 +0100 Subject: [PATCH] Jsonrpc: improve performance of process filter function `run-at-time' keeps `timer-list' list sorted by inserting each timer based on the timer value. This means that `timer--time-less-p' needs is executed ~ N*N/2 times for each N pending messages. This means that jsonrpc becomes unusable for connections that generate a lot messages at the same time. * lisp/jsonrpc.el (Version): Bump to 1.0.25 (jsonrpc--process-filter): Improve performance --- lisp/jsonrpc.el | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 14fe0447008..5037d8c5b2b 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ =20 ;; Author: Jo=C3=A3o T=C3=A1vora ;; Keywords: processes, languages, extensions -;; Version: 1.0.24 +;; Version: 1.0.25 ;; Package-Requires: ((emacs "25.2")) =20 ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -760,10 +760,11 @@ jsonrpc--process-filter (setq message (plist-put message :jsonrpc-json (buffer-string))) - (process-put proc 'jsonrpc-mqueue - (nconc (process-get proc - 'jsonrpc-= mqueue) - (list message))))) + ;; Put new messages at the front of the qu= eue, + ;; this is correct as the order is reversed + ;; before putting the timers on `timer-lis= t'. + (push message + (process-get proc 'jsonrpc-mqueue)))) (goto-char message-end) (let ((inhibit-read-only t)) (delete-region (point-min) (point))) @@ -782,11 +783,20 @@ jsonrpc--process-filter ;; non-locally (typically the reply to a request), so do ;; this all this processing in top-level loops timer. (cl-loop + ;; `timer-activate' orders timers by time, which is an + ;; very expensive operation when jsonrpc-mqueue is large, + ;; therefore the time object is reused for each timer + ;; created. + with time =3D (current-time) for msg =3D (pop (process-get proc 'jsonrpc-mqueue)) while msg - do (run-at-time 0 nil - (lambda (m) (with-temp-buffer - (jsonrpc-connection-receive conn = m))) - msg))))))) + do (let ((timer (timer-create))) + (timer-set-time timer time) + (timer-set-function timer + (lambda (conn msg) + (with-temp-buffer + (jsonrpc-connection-receive conn m= sg))) + (list conn msg)) + (timer-activate timer)))))))) =20 (defun jsonrpc--remove (conn id &optional deferred-spec) "Cancel CONN's continuations for ID, including its timer, if it exists. --=20 2.39.3 (Apple Git-145) --=-=-=-- From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Mar 2024 08:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 69241@debbugs.gnu.org Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.170997460114566 (code B ref 69241); Sat, 09 Mar 2024 08:57:01 +0000 Received: (at 69241) by debbugs.gnu.org; 9 Mar 2024 08:56:41 +0000 Received: from localhost ([127.0.0.1]:60610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1risVU-0003ms-Nb for submit@debbugs.gnu.org; Sat, 09 Mar 2024 03:56:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1risVS-0003md-LA for 69241@debbugs.gnu.org; Sat, 09 Mar 2024 03:56:39 -0500 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 1risUq-0000q0-KQ; Sat, 09 Mar 2024 03:56:00 -0500 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=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=; b=j+QPkDNZ/khL+bPu/P8k pa6LXFg9HuzOyRY7RFthYf87y3CtcRbuARGHCExS8F50kAd7YSEnovFYvbdj2ES3kQ1wrosZdnlhI Xjm9iT6PQ5NcLRmf3yCcGsuCLzGi2ndBvx6bbJfuNJHYgeFp9XY4Q2PaTCpQLQ/gaoFZwvUtcLXge 66bWandxsbs+ZdESNOIFi8QVoKZ2ITz+Mfo6Qh1FAF9UuSAWzv0X+nnvDikMXRlvlRShyYajVGzWu vk+tThLRTfFEscDH1COB+XD0As2h6GobTt62vUsY9gibjFFI1cajSkLUnZs050UVdUahUdn/cdZr7 6QoCqhmBYVHDGg==; Date: Sat, 09 Mar 2024 10:55:51 +0200 Message-Id: <86o7bnyeaw.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Wed, 28 Feb 2024 13:22:50 +0100) References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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 unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Mar 2024 08:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 69241@debbugs.gnu.org Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.170997465514673 (code B ref 69241); Sat, 09 Mar 2024 08:58:02 +0000 Received: (at 69241) by debbugs.gnu.org; 9 Mar 2024 08:57:35 +0000 Received: from localhost ([127.0.0.1]:60615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1risWN-0003ob-40 for submit@debbugs.gnu.org; Sat, 09 Mar 2024 03:57:35 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1risWK-0003oJ-SA for 69241@debbugs.gnu.org; Sat, 09 Mar 2024 03:57:33 -0500 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 1risVi-00013f-Rv; Sat, 09 Mar 2024 03:56:55 -0500 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=JL5t2GkyfHn5AenKSL2wXoBcpWfglQSTFqr582x3J2E=; b=D4lafg2/R9e7VpS+zywf 7SWDXOEhfpT9zDPAILtqEBPTiLlFnHhXqive/vkp7J1TbWYNsE+6OPuK3RJFas/CzhADDV8tYZPak xW+r6jAZeA1MBj98oUYSpO+fEoxdMsFrYPLgmSXa92BfKwb0DcXQRfbo+mu0Znx9niZip+axivwEV bHHVxWBa6BUHTBW94l5zY+0b20hm09gMh6qucdXtsb4nDV5OxiaZ5X9sUDD2Tn0kELgyEucqoiMYZ sMgNkPxdWQcw+2mS5UPUc3lMa4mAhOpO6s4Fn//Q+GzbDkyAWOxiyBYq9lTpDPnU5HL1ai2mwCiHV M9m9fNZ4+Kckng==; Date: Sat, 09 Mar 2024 10:56:42 +0200 Message-Id: <86msr7ye9h.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Wed, 28 Feb 2024 13:22:50 +0100) References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Date: Wed, 28 Feb 2024 13:22:50 +0100 > > The previous patch included an large regression, where "batch" of > messages where handled as an LIFO. This patch should fix the issue and > also removes the dependency on timer.el internal apis. Which makes it > instead dependent on undocumented behavior that timers of equal time are > executed in LIFO order. Joćo, any comments or suggestions? Should I install this? > >From c4d5ddb9ce5cdb8c283928daf6b166e4ce5a430d Mon Sep 17 00:00:00 2001 > From: Daniel Pettersson > Date: Wed, 28 Feb 2024 13:03:56 +0100 > Subject: [PATCH] Jsonrpc: improve performance of process filter function > > `run-at-time' keeps `timer-list' list sorted by inserting each timer > based on the timer value. This means that `timer--time-less-p' needs is > executed ~ N*N/2 times for each N pending messages. This means that > jsonrpc becomes unusable for connections that generate a lot messages at > the same time. > > * lisp/jsonrpc.el (Version): Bump to 1.0.25 > (jsonrpc--process-filter): Improve performance > --- > lisp/jsonrpc.el | 28 +++++++++++++++++++--------- > 1 file changed, 19 insertions(+), 9 deletions(-) > > diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el > index 14fe0447008..5037d8c5b2b 100644 > --- a/lisp/jsonrpc.el > +++ b/lisp/jsonrpc.el > @@ -4,7 +4,7 @@ > > ;; Author: Joćo Tįvora > ;; Keywords: processes, languages, extensions > -;; Version: 1.0.24 > +;; Version: 1.0.25 > ;; Package-Requires: ((emacs "25.2")) > > ;; This is a GNU ELPA :core package. Avoid functionality that is not > @@ -760,10 +760,11 @@ jsonrpc--process-filter > (setq message > (plist-put message :jsonrpc-json > (buffer-string))) > - (process-put proc 'jsonrpc-mqueue > - (nconc (process-get proc > - 'jsonrpc-mqueue) > - (list message))))) > + ;; Put new messages at the front of the queue, > + ;; this is correct as the order is reversed > + ;; before putting the timers on `timer-list'. > + (push message > + (process-get proc 'jsonrpc-mqueue)))) > (goto-char message-end) > (let ((inhibit-read-only t)) > (delete-region (point-min) (point))) > @@ -782,11 +783,20 @@ jsonrpc--process-filter > ;; non-locally (typically the reply to a request), so do > ;; this all this processing in top-level loops timer. > (cl-loop > + ;; `timer-activate' orders timers by time, which is an > + ;; very expensive operation when jsonrpc-mqueue is large, > + ;; therefore the time object is reused for each timer > + ;; created. > + with time = (current-time) > for msg = (pop (process-get proc 'jsonrpc-mqueue)) while msg > - do (run-at-time 0 nil > - (lambda (m) (with-temp-buffer > - (jsonrpc-connection-receive conn m))) > - msg))))))) > + do (let ((timer (timer-create))) > + (timer-set-time timer time) > + (timer-set-function timer > + (lambda (conn msg) > + (with-temp-buffer > + (jsonrpc-connection-receive conn msg))) > + (list conn msg)) > + (timer-activate timer)))))))) > > (defun jsonrpc--remove (conn id &optional deferred-spec) > "Cancel CONN's continuations for ID, including its timer, if it exists. > -- > 2.39.3 (Apple Git-145) > From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 09 Mar 2024 10:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, Daniel Pettersson Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.170998189617115 (code B ref 69241); Sat, 09 Mar 2024 10:59:02 +0000 Received: (at 69241) by debbugs.gnu.org; 9 Mar 2024 10:58:16 +0000 Received: from localhost ([127.0.0.1]:60776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riuPA-0004Rz-BZ for submit@debbugs.gnu.org; Sat, 09 Mar 2024 05:58:16 -0500 Received: from mail-lj1-f171.google.com ([209.85.208.171]:43195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riuP7-0004Rb-DC for 69241@debbugs.gnu.org; Sat, 09 Mar 2024 05:58:15 -0500 Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d3fb16f1a9so39764021fa.0 for <69241@debbugs.gnu.org>; Sat, 09 Mar 2024 02:57:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709981795; x=1710586595; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8X+dx/mspg8fcY00O3niQYLX0PP+6HjF/xLZ8WPF2iE=; b=BM3++yL1+agA5YFIrrWFyTYu8J0JmI3h5IhrQCmn9BAPhktE0ff3s3wXoJGjs0yLZa XSRC/MCR/MANrhvyZtjfYDQeWhTMRtCnzV+5AgWhCTm4WhbDeI2jwueEOoRkFKxD9db6 XA5jNdlXsWuW0m2gxqQipjqgQ8rGHu7FtWgAKan3gq9QfAeQJDxI5zJW2BrfGnp6DWiM lY10D5PCfgF1m+rXqw7C/D9U2ZnYvtAciSTVJJMCrunJRcfzdVFFZ1nqF9KWD+pkMBMR jqYIiLWuRLshc42iiTYyscj7LmlAYvn3W58tyyyu1Vv/UrVs39pp7ATYCsBGXZdlKDaw y1LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709981795; x=1710586595; h=content-transfer-encoding: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=8X+dx/mspg8fcY00O3niQYLX0PP+6HjF/xLZ8WPF2iE=; b=F1SP71vFK8ZqVf0Y0c1bylDTXreQE4bpzDP40br26wvWYqBfl6tSyIhQzE2rz6eeKd h1Qe0VdMHvmD/Ta0PJ30IgYItH8yRto0J++IZ1PO0zIpD9ALFmztj2h8xsEcL4SzEKIK 0/jQIHgNTHumWeZL265dDiGPmnbeH8ZWUaR8+AmtpgBhpoiDJ3jMtdPUUNFyA2G6KBBx WYAAkDTm6bg8yMZ+mlvjF5Qcsr9jsJXaFZ4lsJ8wjOSThD0gwfV1YvsTCXqdLWLw7fcs QoBdvIrpFXv+aJanK2rt91Qh0fk79ls9ZFjYt/2BnCGZT4X377zc395g5g0Ul9xFOyeG mqFA== X-Forwarded-Encrypted: i=1; AJvYcCWmqreo1YgHmYG4xMD0Ep7ovAmugD/aDfvieXbTSvOAmn/AWS+8b1O4Cw4TDEAkKx8/3VOseGxeFDmev71pZtxtHhipNVQ= X-Gm-Message-State: AOJu0YzpGk8M1jDW0SHDZd8pPQmmyZMZ/e8M4lmALAOLpLmeLS2gi2Yr fVDWlS2VDW29y4u4Crnxlo8ZO/qZ6ebGy4M1yRvNxmeN0J7mpiYUIP8mrpD/pfAj/kSgU2lKDjS xm6+RR128wTZjU0iiGK1US80rZ/E= X-Google-Smtp-Source: AGHT+IE6wVxaQfRsIY+yi2zt4EMvu2e22VsV4qs0pVck7PjVHO5Kf6bd8ps1IzP642thxH/d0rlS5oZqlLopvTEZAZw= X-Received: by 2002:a2e:9f50:0:b0:2d3:ed17:1f53 with SMTP id v16-20020a2e9f50000000b002d3ed171f53mr854973ljk.19.1709981794336; Sat, 09 Mar 2024 02:56:34 -0800 (PST) MIME-Version: 1.0 References: <86msr7ye9h.fsf@gnu.org> In-Reply-To: <86msr7ye9h.fsf@gnu.org> From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Sat, 9 Mar 2024 10:56:22 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 Sat, Mar 9, 2024 at 8:56=E2=80=AFAM Eli Zaretskii wrote: > > > From: Daniel Pettersson > > Date: Wed, 28 Feb 2024 13:22:50 +0100 > > > > The previous patch included an large regression, where "batch" of > > messages where handled as an LIFO. This patch should fix the issue and > > also removes the dependency on timer.el internal apis. Which makes it > > instead dependent on undocumented behavior that timers of equal time ar= e > > executed in LIFO order. > > Jo=C3=A3o, any comments or suggestions? Should I install this? >From where I stand, Daniel Pettersson is the new Jsonrpc maintainer. I'd g= ive him push rights so he can install this and push any follow-up fixes easily. From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 69241@debbugs.gnu.org, Eli Zaretskii Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171008094410510 (code B ref 69241); Sun, 10 Mar 2024 14:30:02 +0000 Received: (at 69241) by debbugs.gnu.org; 10 Mar 2024 14:29:04 +0000 Received: from localhost ([127.0.0.1]:37676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjKAi-0002jR-4y for submit@debbugs.gnu.org; Sun, 10 Mar 2024 10:29:04 -0400 Received: from mail-lj1-f181.google.com ([209.85.208.181]:55734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjKAg-0002ix-FL for 69241@debbugs.gnu.org; Sun, 10 Mar 2024 10:29:03 -0400 Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d4141c4438so50988341fa.3 for <69241@debbugs.gnu.org>; Sun, 10 Mar 2024 07:28:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710080903; x=1710685703; 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=dLJuuHeZT/2A77x6YQL+pcAIGmYLKnQcPPgY2t6XSI8=; b=SESawuF9A86epsIBUsxPr3bI0EDYgGP8qf8NBPwipzyu7pBKH72NZUB6H/lDLgpMoD fjC3itvcPJ884/AbuXD72vbEChK2c1lzjCSIsGuhTSCFJ3bmHVKjyPWowuMCRrKFcqDd qOtMw3tuF+4mlVN5LyksR38ga+81PXn7Qvt+0bsjze9es1oixrUFDir4+Sv7aIcYnSyQ Xt6kcJyT5MyQ6qXH9F7CRo/RUHoiRLYBcJAU+4dDKImnRQ9RKoNbKuISgb+Jatiq1hhZ iFHht4Tb82p2X+sQP8YGVUQJn9oP9WXLVeuseAoUSqpbAzBL4GSGTfkqnozvVagDw8C0 qOng== X-Forwarded-Encrypted: i=1; AJvYcCVrVzjnIU9dzLbiIl1eaimlZpHYK/vSeBDYg3k4tbapqbAzwOFqPLeCgLWM2GcLksrGJFneW/C5slRvFoTpztu8Y32g/70= X-Gm-Message-State: AOJu0YycqaOVW41RGHUBetQbi0973uYflOFIPOBNSy9nq2fRjsXNJdyZ A7pQ8e8h7ItinCo8Z2DvGc7c3xOpZ6q12x9UHF2LRr1RTftxe865mmEO6mXE X-Google-Smtp-Source: AGHT+IHaBA0ka1WR6su1W7YLJytGXIL9xAFoYxS4em7BPz3XbyoSOY+Bzb6so7wP45G0ddafwZ4PXQ== X-Received: by 2002:a2e:909a:0:b0:2d2:f0f9:af0 with SMTP id l26-20020a2e909a000000b002d2f0f90af0mr2615165ljg.37.1710080902915; Sun, 10 Mar 2024 07:28:22 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id y21-20020a2e7d15000000b002d2dfe8a36csm700527ljc.96.2024.03.10.07.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 07:28:22 -0700 (PDT) From: Daniel Pettersson In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sat, 9 Mar 2024 10:56:22 +0000") References: <86msr7ye9h.fsf@gnu.org> Date: Sun, 10 Mar 2024 15:28:21 +0100 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.2 (/) 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.8 (/) Jo=C3=A3o T=C3=A1vora writes: > From where I stand, Daniel Pettersson is the new Jsonrpc maintainer. I'd= give > him push rights so he can install this and push any follow-up fixes easil= y. As I have previously stated I am willing to take on the maintainer role for Jsonrpc.=20=20 > + ;; `timer-activate' orders timers by time, which is an > + ;; very expensive operation when jsonrpc-mqueue is large, > + ;; therefore the time object is reused for each timer > + ;; created. I am interested in what both of you think about relying on undocumented behavior. To grasp the scope of this issue, an adapter server sent 50 000 messages. With `read-process-output-max' set to the platforms max, each of those messages where placed on `timer-list' in the same call to jsonrpc's filter function, which then had to be sorted as O(N^2) (calls to timer--time-less-p).=20 Which makes Jsonrpc unusable for that particular server. From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, Eli Zaretskii Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171008175911709 (code B ref 69241); Sun, 10 Mar 2024 14:43:02 +0000 Received: (at 69241) by debbugs.gnu.org; 10 Mar 2024 14:42:39 +0000 Received: from localhost ([127.0.0.1]:37680 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjKNp-00032l-JQ for submit@debbugs.gnu.org; Sun, 10 Mar 2024 10:42:39 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:52703) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjKNl-00032V-Gs for 69241@debbugs.gnu.org; Sun, 10 Mar 2024 10:42:35 -0400 Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2d40fe2181dso28045911fa.1 for <69241@debbugs.gnu.org>; Sun, 10 Mar 2024 07:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710081654; x=1710686454; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=F0BB0PEKRQugwhzJfszMJGz+DycNdODvQ3K0xQsnqVY=; b=Dq6vzWy1Z4SdFYEBWEdVz3ulgQjhRueX2+0X8HKkYLqybJQDEmaW67JDTZ5fVY+pGg rxLgvfa8Sybx9QjgY/uMCICemTlciROGGBfXIDsms+zF2Os8lghbHYni21Dl+hGKQ8Un FkjYsUasA/qH0T3V/IGTWc1wKQls2sYh+ZI0XrGUaPkRuiACrtO8QNwRhJhC9WhthmJA knKUS10L/Jldbyp6r8Mnz6dg4cAzVNvZmUg8EtkF+tt5DC/5aHoPTUobQZCryoo5Dzmm Kzb2uBPepfhhb/JE4bB1KW8bLFOsnyuptNt73v66VkAkVQVQg+4dOg+hJQIXT37zTM+j wcKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710081654; x=1710686454; h=content-transfer-encoding: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=F0BB0PEKRQugwhzJfszMJGz+DycNdODvQ3K0xQsnqVY=; b=iCU3SnCu9/3SX+bI8onNH5BdCRC+OeyKyDj4t0vFu7TgHIkmudW+yQnasFHjvYeSkT J2O5VRvnY3EVl/ygn0j+gD/+oVJh05yVI7EyCkKENjfd4vY0IF6es9JwfeGEVLCFG9u1 lNGvKG8UTON9bERTx82givTBQFfr2GtuWECDKEBsxcYYmj4w1Qiw4WfNgiSGTIwJouPU 5fMQKxOMg3eYvXqWRr3WzFkrZ+ETZuZR+TSwVpAcTn9OgU1Jhq2/IQM+WF1TMmm9HBL0 fLwSY1Uiyb9hq8BtGEZF/VR5aQqsr4/TRYP2ZOPUEV6pxEkCZs2t0aIFqzSsFAdjOr9n RXyw== X-Forwarded-Encrypted: i=1; AJvYcCVB1kJJYhYEEZDZm/sw13UwjyDzW8TfoSyKeOhqy7P1G7XVyhYted9oxuzvSSxgi2y109eGe5hlI9S1BQ9tU49MRoOIo6o= X-Gm-Message-State: AOJu0YxQskQ/pWi6HOC+vWIsmIfN2JGXxPki8c/esXBmeVzkdeb+ChTT z1+IhzjzhI7+8yUOk+RmE64P/9fakt0e7DrL1UmIdWBMFXNIb8ajgYSzaxoMAP0CGkzSv3Pbhtw rmrKu4G7gMcKdzALCe5Q5jE6+EkJQ6c1G/AI= X-Google-Smtp-Source: AGHT+IF0R5BgCTXuyKnvqxFQvL6XRVSJDooTZOIGpY03y59f2GUNkvU07qou6QlY9rTPcVFo6ZrZX1lk0RORYy3rTuI= X-Received: by 2002:a2e:928c:0:b0:2d2:7813:6ca3 with SMTP id d12-20020a2e928c000000b002d278136ca3mr2437341ljh.9.1710081653854; Sun, 10 Mar 2024 07:40:53 -0700 (PDT) MIME-Version: 1.0 References: <86msr7ye9h.fsf@gnu.org> In-Reply-To: From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Sun, 10 Mar 2024 14:41:07 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) 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 Sun, Mar 10, 2024 at 2:28=E2=80=AFPM Daniel Pettersson wrote: > As I have previously stated I am willing to take on the maintainer role > for Jsonrpc. Thank you Daniel. It'll be in very good hands. > > + ;; `timer-activate' orders timers by time, which is an > > + ;; very expensive operation when jsonrpc-mqueue is large, > > + ;; therefore the time object is reused for each timer > > + ;; created. > > I am interested in what both of you think about relying on undocumented > behavior. > > To grasp the scope of this issue, an adapter server sent 50 000 > messages. With `read-process-output-max' set to the platforms max, each > of those messages where placed on `timer-list' in the same call to > jsonrpc's filter function, which then had to be sorted as O(N^2) > (calls to timer--time-less-p). > > Which makes Jsonrpc unusable for that particular server. I think your analysis is sound, Daniel. As you have noticed the run-at-time= 0 is not to actually use a timer, but just to get a call that is independent from the current call stack which may be nested because of the use case of bug#67945. The calls must be processed in the order of the queue though, but in theory that shouldn't lead to O(N^2) if a suitable technique is found (perh= aps different from (run-at-time 0)). Finally 50.000 is a gigantic amount -- are all of these essential? Can't t= he server coalesce this data into fewer messages within the DAP protocol? Jo=C3=A3o From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 16:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171008925625774 (code B ref 69241); Sun, 10 Mar 2024 16:48:02 +0000 Received: (at 69241) by debbugs.gnu.org; 10 Mar 2024 16:47:36 +0000 Received: from localhost ([127.0.0.1]:37773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjMKl-0006he-Sh for submit@debbugs.gnu.org; Sun, 10 Mar 2024 12:47:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjMKi-0006hQ-UQ for 69241@debbugs.gnu.org; Sun, 10 Mar 2024 12:47:34 -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 1rjMK1-0003qu-Cw; Sun, 10 Mar 2024 12:46:53 -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=o1OC8u+v0A7hMRbqtNkve/0PlOBxolOD6C0zQVaKso0=; b=FQiAKfFEKlR0 0TBn4YzrlWXk6fLO6vRRNgLHR+0fqRzEr5/oVQaAbH0GiK/i4+u02VDFaqiEaScpSgr4ATfBg+BGh BdJxFd3OhvVy4rc1HH9tv/zDuNTS8oFty9pRICBeJ38iRlZHTEYxRFXhyW63pJckjkTRenbKJxSSk uxZDEK+zYuU5zn9H+iCIv9D49+YqudHmAeGCAuYkB2quchxTFZkCpUqF19Qjyma8kFqtoakuA77K7 pYkBSJpVH01TI/82gZI/4FgIMfG/2m27P/RqfY+7nXGZqjzBTqKdLMGuODtKJnygTBXPdUvg3E1Xa hQEYGKfq+lejZu46sKw57A==; Date: Sun, 10 Mar 2024 18:46:45 +0200 Message-Id: <86y1aquj9m.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Sun, 10 Mar 2024 15:28:21 +0100) References: <86msr7ye9h.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Cc: Eli Zaretskii , 69241@debbugs.gnu.org > Date: Sun, 10 Mar 2024 15:28:21 +0100 > > As I have previously stated I am willing to take on the maintainer role > for Jsonrpc. Thank you. Should we reflect that in admin/MAINTAINERS? > To grasp the scope of this issue, an adapter server sent 50 000 > messages. With `read-process-output-max' set to the platforms max, each > of those messages where placed on `timer-list' in the same call to > jsonrpc's filter function, which then had to be sorted as O(N^2) > (calls to timer--time-less-p). I don't see where the list is sorted with the above behavior. Can you point out which code you allude to? From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 20:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171010119013668 (code B ref 69241); Sun, 10 Mar 2024 20:07:01 +0000 Received: (at 69241) by debbugs.gnu.org; 10 Mar 2024 20:06:30 +0000 Received: from localhost ([127.0.0.1]:37939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjPRF-0003YO-HY for submit@debbugs.gnu.org; Sun, 10 Mar 2024 16:06:29 -0400 Received: from mail-lj1-f181.google.com ([209.85.208.181]:51673) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjPRD-0003YA-40 for 69241@debbugs.gnu.org; Sun, 10 Mar 2024 16:06:27 -0400 Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d29aad15a5so36164231fa.3 for <69241@debbugs.gnu.org>; Sun, 10 Mar 2024 13:05:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710101148; x=1710705948; h=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=x4wNnDtwRkAuBwVxyih+lnV1oxDfjyWds6tq6ifgwpw=; b=NGdVQFNhBud80SzUOkjN0khQRQWcG6rxmiUgrj/cQkuKpAW32TsrNCarcEr8m7ZU/O v5B+j5TXsmGiyDyEZkleIEooPvR23sxcI0yIxGIwdNVDPw3prVnGRQnlJfc8cvW+eNR+ iVEZ4eegkfXMsQewHP1vu8rPZo46fvelqHOTYHFpD2jZKj0ixDIZmANiRoBC1o43rHCo HAF1HbxtF80QHZc6AndX0TvdNJJFA8djyJsA2l7Ldf6WnFtcketaHnhNI94kLsyB4MMn ibpNf59rdw0vso0goGsvfW0NXuWw/BjBVCqOASsYM/URBUX74YdpX5e0KHvYont7wKk3 ENqA== X-Forwarded-Encrypted: i=1; AJvYcCW9IeFMmSlnpbrkFnK88wyXAKiqHRb5wiNTP1kU0DdIuhdKtnoWuFeNM+ED1gAe71BEpNWI9bq6H+5EDHrptj8TYY7B5y0= X-Gm-Message-State: AOJu0YzH8tj4Obdlt6msaWwUol7anBWVlPIjrquTl5kmkt2F9ZuWpTWh YFT1lQBTJK5Wh9YQbx2XNvsc8RqmBy/xnlTHJl8Z6dZgBjOT3HztBOvy4Hrh X-Google-Smtp-Source: AGHT+IFDoPd89kxTKRC4hfaL2lSzuOtEBhan5kRmfhJohmVj18/pUcUFoVmqSKvbgDt81Qno/11Xrw== X-Received: by 2002:a05:6512:308d:b0:513:1f2c:328d with SMTP id z13-20020a056512308d00b005131f2c328dmr3689836lfd.69.1710101147412; Sun, 10 Mar 2024 13:05:47 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id r10-20020ac25a4a000000b005132bf49f99sm766533lfn.140.2024.03.10.13.05.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 13:05:47 -0700 (PDT) From: Daniel Pettersson In-Reply-To: <86y1aquj9m.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 10 Mar 2024 18:46:45 +0200") References: <86msr7ye9h.fsf@gnu.org> <86y1aquj9m.fsf@gnu.org> Date: Sun, 10 Mar 2024 21:05:46 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.8 (/) Eli Zaretskii writes: > Thank you. Should we reflect that in admin/MAINTAINERS? That is fine by me. I am not sure what the impact of that would be? > I don't see where the list is sorted with the above behavior. Can you > point out which code you allude to? Let's continue use the implementation on `master' and my example to give it some. In my example process property 'jsonrpc-mqueue is an list of ~50,000 messages. In `jsonrpc--process-filter' we evaluate `run-at-time' macro, which in turn invokes `timer--activate'. (cl-defun jsonrpc--process-filter (proc string) ... (cl-loop for msg = (pop (process-get proc 'jsonrpc-mqueue)) while msg do (run-at-time 0 nil (lambda (m) (with-temp-buffer (jsonrpc-connection-receive conn m))) msg))))))) `timer--active' makes sure that the `timer-list' is sorted by time to trigger in ascending order: (defun timer--activate (timer &optional triggered-p reuse-cell idle) ... ;; Skip all timers to trigger before the new one. (while (and timers (timer--time-less-p (car timers) timer)) (setq last timers timers (cdr timers))) ;; Insert new timer after last which possibly means in front of queue. (setf (cond (last (cdr last)) (idle timer-idle-list) (t timer-list)) reuse-cell) This is especially bad when the time of the timer is created inside a loop as in `jsonrpc--process-filter'. Let's take the last loop iteration in the `cl-loop'; timer_{N} from N messages. timer_{N} will always be compared with timer_{1}, timer_{2}, ... timer_{N-2}, timer_{N-1}. This ends up with doing N^2/2 timer comparisons in `jsonrpc--process-filter'. Hopefully my ramblings makes things clearer. /Daniel From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 23:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.1710113476828 (code B ref 69241); Sun, 10 Mar 2024 23:32:02 +0000 Received: (at 69241) by debbugs.gnu.org; 10 Mar 2024 23:31:16 +0000 Received: from localhost ([127.0.0.1]:38157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjSdP-0000DF-Rn for submit@debbugs.gnu.org; Sun, 10 Mar 2024 19:31:16 -0400 Received: from mail-lf1-f46.google.com ([209.85.167.46]:43025) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjSdN-0000D2-Ol for 69241@debbugs.gnu.org; Sun, 10 Mar 2024 19:31:14 -0400 Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-51331634948so4404093e87.0 for <69241@debbugs.gnu.org>; Sun, 10 Mar 2024 16:30:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710113434; x=1710718234; h=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=dIVmsliJBFxA1ftN5DYMGub8v5pzDojgE0nqQIVtICw=; b=H0VTKbmsWkAQqNTQX2ytU3MllHYQ358zVRr2VvkYJiFcmx/7iRzw9AjrLrilV/1lMF K82k05b6uEH6ztrSYoGyJcYn1799BwIH0rCsKWDyV95BZ+H9tPJfS0yle9xp2TDfW1WJ qedOomPOSGFLj4VScwhhwaBj7kXibFKJwt+uBtateDwAVDEH64EIRfrZlmOcca7g7JZ1 vbTxZLYlPbnqS0eUrEkrwji3vY0kt0yi4s5FE/yiAFqe0kBALBHmMBPoSDItmUnLRYC7 rIysX+ZyHA3KeGA8Kq/hXe1OO1CR+gW8iDlkRg77Ujniu6OKNxaws+Q+Fhm+X+q8BmpN JLMg== X-Forwarded-Encrypted: i=1; AJvYcCVCpnVgdP+sAjjG18xoevUSC2hk+UymInL2S20S6vi49opYH+wjaV2vg9q5v3UR6U3xc+mXzRrvdrstFoqB3k2/Ue/u2o0= X-Gm-Message-State: AOJu0YzzXBJNuKoIDGjP3/p43+I3xapoKIwqmrmCEAw08EpN7uUJNCG5 PdwsGoascqjxIoWdfN3GLBEWEN4ysBypQ5vG2Glv39vFcMubA1cFcPA8Gmee X-Google-Smtp-Source: AGHT+IHba2sOPuiXBRPH/ZkDPCAJG1zHFJ7TSejL40pAYVLOTl4uOxcCzHhA70u+1TAMuE4JFd7pIA== X-Received: by 2002:ac2:4e61:0:b0:513:a943:d5b8 with SMTP id y1-20020ac24e61000000b00513a943d5b8mr425013lfs.4.1710113433905; Sun, 10 Mar 2024 16:30:33 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id k22-20020ac24f16000000b00513576af080sm850958lfr.126.2024.03.10.16.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 16:30:33 -0700 (PDT) From: Daniel Pettersson In-Reply-To: (Daniel Pettersson's message of "Sun, 10 Mar 2024 21:05:46 +0100") References: <86msr7ye9h.fsf@gnu.org> <86y1aquj9m.fsf@gnu.org> Date: Mon, 11 Mar 2024 00:30:32 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.8 (/) Daniel Pettersson writes: > In my example process property 'jsonrpc-mqueue is an list of ~50,000 > messages. I have to make an correction here, even if it does not really matter but an extra zero seams to have made it's way into these conversation. The benchmark I have been benchmarking against is ~5,000 messages. 12,500,000 (N^2/2) calls to `timer--time-less-p' is enough to make any machine crawl to a halt. > /Daniel From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 09:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 69241@debbugs.gnu.org, Eli Zaretskii Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.1710150322673 (code B ref 69241); Mon, 11 Mar 2024 09:46:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 09:45:22 +0000 Received: from localhost ([127.0.0.1]:38865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjcDi-0000Am-Gh for submit@debbugs.gnu.org; Mon, 11 Mar 2024 05:45:22 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:44127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjcDg-0000AY-3R for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 05:45:20 -0400 Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-5131316693cso5517558e87.0 for <69241@debbugs.gnu.org>; Mon, 11 Mar 2024 02:44:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710150280; x=1710755080; 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=tYbH+6LCJfRxjVMTg3g96eUlJ3J4CXCiN2pKVhitxLE=; b=swYkts5JZldMpvkYu2xYlv2h2ddUuL/YaTPgsD6m2tvpbOI+AJo9k0X1oSluEY4G/F RJ4FQGmdUTvWnNcMHoHpsDAP38NdprjSUxQeLhYwVCOsmxgjxllV8oXxgt9MtFr7yMdL DdIp/NKJWfAbF7A2BYYauBPwQ+HN0mMNL85dMh996wievXfMub9fIkFSysXxht29rUNn d1ZDJ6PSjdrxCdzcR4YXok5dPIK/BH/rCImTbgFF9Ux2fakZ3W5xq5OBtGdr65btclYJ 6PTNuwuH+/OFJ/zFh6PdSNijGw/Pg2ncaK97WsWo49kHdmPLB/a9Q7YI/YOM3+JIq2sc m/ow== X-Forwarded-Encrypted: i=1; AJvYcCXyMVaz9LeBC6ge+LEkGdlCMTgwP1TEk38rtCEiac1C62u2LsPmY3HlKAjap0rXsEopuiCk8zpBUkpPReLiKazng1cMJvA= X-Gm-Message-State: AOJu0YxxWRgZGPacjShpvv8l39Jde1rJSNEdYcxV6OlnwQ4dE2n6Tbvy 5uLfKtpdMHhp7KI09/Dcir0lnKOZrmRVTt4drZ+6ocx0aZlli7tQqC3oZbR/ X-Google-Smtp-Source: AGHT+IHC3hVInOO5QaLgEZU9lYsei6AXX9t7HY0wHUkYdEuJdPkmn21InWojg9mo7F/cRg25zGfIWg== X-Received: by 2002:a05:6512:402:b0:513:19cb:be72 with SMTP id u2-20020a056512040200b0051319cbbe72mr4272166lfk.64.1710150279917; Mon, 11 Mar 2024 02:44:39 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id t4-20020a056512208400b00513a1c0c85bsm753081lfr.14.2024.03.11.02.44.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 02:44:39 -0700 (PDT) From: Daniel Pettersson In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?="'s message of "Sun, 10 Mar 2024 14:41:07 +0000") References: <86msr7ye9h.fsf@gnu.org> Date: Mon, 11 Mar 2024 10:44:38 +0100 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.2 (/) 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.8 (/) Jo=C3=A3o T=C3=A1vora writes: > The calls must be processed in the order of the queue though, but in > theory that shouldn't lead to O(N^2) if a suitable technique is found (pe= rhaps > different from (run-at-time 0)). The first patch I sent had this issue of them being process out of order. But the second patch ensures that they are handled correctly. It may look like they don't but they do :) 1. We push each message on 'jsonrpc-mqueue (Order is reversed) 2. We pop each item of 'jsonrpc-mqueue and push (Guaranteed by sharing the same `time' for each timer) the item on `timer-list'. 3. Timers are evaluated in the order of `timer-list'. Simplified: (setf timer-list (append (reverse (reverse messages)) timer-list)) :) This is not that straight forward and loops back to my point of relying on timer.el internals, but as I see it there is no other way, if one would like to get around the internal sorting of timers in timer.el which I would very much like to do. > Finally 50.000 is a gigantic amount -- are all of these essential? Can't= the > server coalesce this data into fewer messages within the DAP protocol? Sorry I made an error it's 5000, this is js-debug sending an list of javascript sources for "medium" sized js React project and no that cant be configured. Which as I stated in my other reply leads to 12,500,000 (N^2/2) calls to `timer--time-less-p' (timer sorting in timer.el) but with my patch only requires 5000. (why does an "medium" sized modern js web project require 5000 sources is the real question we need to ask ourselves) /Daniel From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 12:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171015988829499 (code B ref 69241); Mon, 11 Mar 2024 12:25:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 12:24:48 +0000 Received: from localhost ([127.0.0.1]:39176 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjehz-0007fh-QA for submit@debbugs.gnu.org; Mon, 11 Mar 2024 08:24:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjehu-0007fQ-OL for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 08:24:46 -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 1rjehH-0000Z3-7S; Mon, 11 Mar 2024 08:24:03 -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=D97RUUh3100p21revjuuYS6HbgTpxd1bgMaakIiTKEo=; b=IZdkvQUUPOJF TV4kWgYosi0PbUn4qPw8cyVRMEjqf/G3K4vEoQuwuMYE5hSKDHHPMzpq0LdHthrrUI7vj4jR9zjiy QWmrykn9x2PZ+PuYIwQWXAJrXajlQMywyNzeS5O7bUlvQtSzrtZyGCiOmdR4iET5XJfAbzyDsqTsd S300//QUcMkXTgBx91N8Zvps5cyfo1ZzAE3501KLFLmrzd4GLtre29NEiznRsKjmrtHiIyf/i8Aif btiWA4TxakZowtf2LEzz0kIMcJDwynkZ2KDr05LI68633Facto6rd6ZErbwUerOJORj0J5yVD+lY1 B69Xt2YzWFc8OOszu4s8cQ==; Date: Mon, 11 Mar 2024 14:24:00 +0200 Message-Id: <86jzm9ufbz.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Sun, 10 Mar 2024 21:05:46 +0100) References: <86msr7ye9h.fsf@gnu.org> <86y1aquj9m.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Cc: joaotavora@gmail.com, 69241@debbugs.gnu.org > Date: Sun, 10 Mar 2024 21:05:46 +0100 > > Eli Zaretskii writes: > > > Thank you. Should we reflect that in admin/MAINTAINERS? > > That is fine by me. I am not sure what the impact of that would be? Just that you express interest in this package and don't mind to be CC'ed when some issue about it comes up. > > I don't see where the list is sorted with the above behavior. Can you > > point out which code you allude to? > > Let's continue use the implementation on `master' and my example to > give it some. > > In my example process property 'jsonrpc-mqueue is an list of ~50,000 > messages. > > In `jsonrpc--process-filter' we evaluate `run-at-time' macro, which in > turn invokes `timer--activate'. > > (cl-defun jsonrpc--process-filter (proc string) > ... > (cl-loop > for msg = (pop (process-get proc 'jsonrpc-mqueue)) while msg > do (run-at-time 0 nil > (lambda (m) (with-temp-buffer > (jsonrpc-connection-receive conn m))) > msg))))))) > > `timer--active' makes sure that the `timer-list' is sorted by time to > trigger in ascending order: > > (defun timer--activate (timer &optional triggered-p reuse-cell idle) > ... > ;; Skip all timers to trigger before the new one. > (while (and timers (timer--time-less-p (car timers) timer)) > (setq last timers > timers (cdr timers))) > ;; Insert new timer after last which possibly means in front of queue. > (setf (cond (last (cdr last)) > (idle timer-idle-list) > (t timer-list)) > reuse-cell) > > This is especially bad when the time of the timer is created inside a > loop as in `jsonrpc--process-filter'. > > Let's take the last loop iteration in the `cl-loop'; timer_{N} from > N messages. > > timer_{N} will always be compared with timer_{1}, timer_{2}, > ... timer_{N-2}, timer_{N-1}. > > This ends up with doing N^2/2 timer comparisons in > `jsonrpc--process-filter'. So the problem is not with timer--activate, the problem is with jsonrpc--process-filter which calls timer--activate, and the net effect of those two is the N^2 complexity, is that right? Your original statement was that the list of timers is sorted with N^2 complexity, and that is the part to which I responded. From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 12:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171016075431002 (code B ref 69241); Mon, 11 Mar 2024 12:40:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 12:39:14 +0000 Received: from localhost ([127.0.0.1]:39181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjevy-00083y-F1 for submit@debbugs.gnu.org; Mon, 11 Mar 2024 08:39:14 -0400 Received: from mail-lf1-f41.google.com ([209.85.167.41]:61725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjevt-00083i-Oq for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 08:39:12 -0400 Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-513298d6859so3983423e87.3 for <69241@debbugs.gnu.org>; Mon, 11 Mar 2024 05:38:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710160709; x=1710765509; h=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=/nBqXXnUpRWMdxBoOUD/x2TlwLOx11DlqXbmIrtcZ8Q=; b=Ve+uDakyFxVjG+AVjK24B03CZ+sdQlFTBqZ3VOIoyKUQydtj6dWcs0TRxvczINdkWA sW+rvRDaNiljuR6yyNupN8pqPIHQBjw6GCPIrnDq3nCBOOodo7nO4b2F0I+0DnZ+Lls+ e6c8Nc8bHYTKlzqb3FnsYebGmmIvEZR9nthmlXOQlBfV6p2J729aAqG6Z/LX4bI2XHzm aJVATt0xaf6XmgcVllv/xW1c0uxpe5y5kO9O5Cau2K/slpqvm6KTd4mYaK+BGrXl8wxT kIZEmqjG8yK7w2aU3yo+YW0J8JStZKS/r9k7giMMmXIaCXVNkJAW/YVe/OM/n/U2UOPR 5iqQ== X-Forwarded-Encrypted: i=1; AJvYcCWoynFvfMHTjYGBxVfNzcopdSKo+fRuWHgc5n7zUDyCRBu/xZHWuztgSNK83cKKEUEbUqyoKF+8VAlhFwQ3tRlIIYirMo0= X-Gm-Message-State: AOJu0Yx7AgLHXXjm0IsJ7q14DWPrKsjk+aAxKvZEdpyvzp9i18qphVs8 UlzhwWA3wj5enufSQtCdGNbWT/YY9DeYBhTof6jvHj//cCgggBbzyx/4SDv9 X-Google-Smtp-Source: AGHT+IHq659ZeHF+xQ+/2rnCHh1TAA9I9XnhLeHO1mgRWaZZpELVqKp9e52kxY6aAgwUpVXYiBAxIw== X-Received: by 2002:ac2:4107:0:b0:513:9e13:6403 with SMTP id b7-20020ac24107000000b005139e136403mr3284022lfi.21.1710160709366; Mon, 11 Mar 2024 05:38:29 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id i11-20020a056512318b00b005139d7a3418sm979701lfe.83.2024.03.11.05.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 05:38:29 -0700 (PDT) From: Daniel Pettersson In-Reply-To: <86jzm9ufbz.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Mar 2024 14:24:00 +0200") References: <86msr7ye9h.fsf@gnu.org> <86y1aquj9m.fsf@gnu.org> <86jzm9ufbz.fsf@gnu.org> Date: Mon, 11 Mar 2024 13:38:28 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.8 (/) Eli Zaretskii writes: > Just that you express interest in this package and don't mind to be > CC'ed when some issue about it comes up. Oh that's fine. > So the problem is not with timer--activate, the problem is with > jsonrpc--process-filter which calls timer--activate, and the net > effect of those two is the N^2 complexity, is that right? Your > original statement was that the list of timers is sorted with N^2 > complexity, and that is the part to which I responded. Correct, sorry if I was being unclear. /Daniel From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 13:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.17101628752507 (code B ref 69241); Mon, 11 Mar 2024 13:15:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 13:14:35 +0000 Received: from localhost ([127.0.0.1]:39220 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjfUB-0000eM-9z for submit@debbugs.gnu.org; Mon, 11 Mar 2024 09:14:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46150) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjfU7-0000e6-T3 for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 09:14:33 -0400 Received: from fencepost.gnu.org ([209.51.188.10]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rjfRN-0002TS-Q2; Mon, 11 Mar 2024 09:11:41 -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=Iv70ggrKdzqY0gnP3ks9ho+61H4qbiO/gCDAdddlnAI=; b=lj6v8t4mSrlYF7pTVGlY 5AJdxpWBE4fHJbF8G6kZLvwRoQiQ/kn9+tB05GLgdBD/Me8FcAUDOJc+rTW8ZOqeUlR4hbuQRGjgI ujW+mM28Fpg6MdorFO3xLKXjXj2zoW9nv9lOepEOIhWlu+hiwy7VvIA23vvSeOitDF4aRFNebMIvi 8X57jdc3dJYK+ftFpDRKl6ysxmRuZKRr+BLajLFzw2s+Ah5GWqwiQyQhAOSDoHA2jLrcJv+IeLj0f Z1KYnWDWiqU0aXHx4qVZ1iN43erxFug/vterfO4y3d+3CBw34aM226NrH8K8O1WxNA0i1AgXaH+1m N205QmN5w0QGXg==; Date: Mon, 11 Mar 2024 15:11:38 +0200 Message-Id: <86edcgvrp1.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Mon, 11 Mar 2024 10:44:38 +0100) References: <86msr7ye9h.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Cc: Eli Zaretskii , 69241@debbugs.gnu.org > Date: Mon, 11 Mar 2024 10:44:38 +0100 > > JoĆ£o TĆ”vora writes: > > > The calls must be processed in the order of the queue though, but in > > theory that shouldn't lead to O(N^2) if a suitable technique is found (perhaps > > different from (run-at-time 0)). > > The first patch I sent had this issue of them being process out of > order. But the second patch ensures that they are handled correctly. > It may look like they don't but they do :) > > 1. We push each message on 'jsonrpc-mqueue (Order is reversed) > 2. We pop each item of 'jsonrpc-mqueue and push (Guaranteed by sharing > the same `time' for each timer) the item on `timer-list'. > 3. Timers are evaluated in the order of `timer-list'. Can't the code activate the timers in reverse order? Then each timer--activate will likely compare with just one timer, the first one. > This is not that straight forward and loops back to my point of relying > on timer.el internals, but as I see it there is no other way, if one > would like to get around the internal sorting of timers in timer.el > which I would very much like to do. Timers must fire in the order of their time, so they must be kept sorted, or else running the timer functions and removing the timer from the list will be much more complex. Assuming that timers are sorted is not relying on the internals, if you ask me. > (why does an "medium" sized modern js web project require 5000 sources > is the real question we need to ask ourselves) Indeed. Any idea of what the answer could be? From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 14:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171016852713864 (code B ref 69241); Mon, 11 Mar 2024 14:49:01 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 14:48:47 +0000 Received: from localhost ([127.0.0.1]:40976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjgxK-0003bW-Jl for submit@debbugs.gnu.org; Mon, 11 Mar 2024 10:48:46 -0400 Received: from mail-lf1-f50.google.com ([209.85.167.50]:49322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjgxH-0003ag-Rr for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 10:48:45 -0400 Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-51344bebe2fso2975081e87.2 for <69241@debbugs.gnu.org>; Mon, 11 Mar 2024 07:48:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710168484; x=1710773284; h=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=R8VN4MhqIzab9AC1V5rt/QVJJ1aXsp7/z7oeZiyoPaY=; b=FT/4Buq+dd2rujAug71JyAE8ubuD6aovs/EONBo5M3ZhyFKfFEGkNUpmfpzWqvA/DL +P1TBMzoiSMNLhsK59t6rUvPDyqKeW+2I9fvCx7EJ6C3ZJB9X9Ut3yiDnseP2kRJ2JEs mYn/brbgiZ5RL9NjONPb8N1h8/kggxIu5WfDEYf8YU4Rrwpdkc2FwONyF56GiudWfK0T q9UN9ryJ9holaQ/5b/ULdiOv0TV4zaSvUGYfGu2jW4E6s9zG1h6AH3Njrk4CwLGhESVP ++KqJ3N4B8DHVRUh27VirgqauMvlWyMm+EvW3YziOSYUK3Cb5KXsXfHvBKju+kWf3S0q pn2g== X-Forwarded-Encrypted: i=1; AJvYcCUPQO/LHyH+5ATPSzGaB23v0DV+rSGNvxaC8DfUcl4LTgUdkWVfxyb54/p3/vlwHydYYUrZH10JJlGoh26hWDL/bxgHsDU= X-Gm-Message-State: AOJu0YwIvfxFRu8Yg1IjokkkSr4063HTTbzeBN6ba1sI8zBqZFrdvYgB DwkWi0Yvv71h2WpZrf/+qWcGIGQwWTnmYxXdGIEcRfRSY5PCffgR9i82pbLJ X-Google-Smtp-Source: AGHT+IEbQfJeff0IctaOmlqTh4pVRgs7WdYo9SIlktEf+tWlkSVbkcsY7KMb76cn617ieG0dPcKfog== X-Received: by 2002:a05:6512:3996:b0:513:4afa:a719 with SMTP id j22-20020a056512399600b005134afaa719mr6405376lfu.59.1710168483762; Mon, 11 Mar 2024 07:48:03 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id f7-20020a05651201c700b00513a7b47c75sm597711lfp.93.2024.03.11.07.48.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 07:48:03 -0700 (PDT) From: Daniel Pettersson In-Reply-To: <86edcgvrp1.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Mar 2024 15:11:38 +0200") References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> Date: Mon, 11 Mar 2024 15:48:02 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.8 (/) Eli Zaretskii writes: > Can't the code activate the timers in reverse order? Then each > timer--activate will likely compare with just one timer, the first > one. In my patch they do. As all timers are using the same time list and pushed on timer-list in the correct order. Feels like *I* have pushed this thread into bikeshedding territory :) > Timers must fire in the order of their time, so they must be kept > sorted, or else running the timer functions and removing the timer > from the list will be much more complex. > > Assuming that timers are sorted is not relying on the internals, if > you ask me. Great, what actions do I need to take to move forward with this maintainership thing? /Daniel From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 16:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171017447624199 (code B ref 69241); Mon, 11 Mar 2024 16:28:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 16:27:56 +0000 Received: from localhost ([127.0.0.1]:41117 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjiVH-0006IE-JE for submit@debbugs.gnu.org; Mon, 11 Mar 2024 12:27:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjiVE-0006I1-SM for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 12:27:54 -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 1rjiUb-0008RB-EC; Mon, 11 Mar 2024 12:27:13 -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=JjkIoJudH3Qh8QsClQYnVexfgK+/SyW6r2I/QmDinrk=; b=lfQbnoYL0Lmm BgXZzbwAfsRSDKvCQKLoGHG7n2v8k+ooMJYG7l1yYwRwRyoflzesvLDiwV3ySDvzVMRFcb6ztWrIx 9xXYfWHPUXnZ9pcykzdQFWbzlvlc271qbUKxCQtERV43SgcJSNbmmmpMWYW/DOtniBzzG/jzOf6Ud x1pBO2YcTgtEglNboboPB0ZYyafZYfNZZIZksTuKwRIVk4he40iE6yIBpG7LwPIByb3xkgzGoUCN9 rZkBYQUsq4/UvUdArgkJfhL4V2KzYvZJcU3PkBsX+eqmCCK40APlg2+gvxgeC+ESrEyqVbhAlPj8D N/nnhozfxvlYjFAAHW3rig==; Date: Mon, 11 Mar 2024 18:27:09 +0200 Message-Id: <864jdcvin6.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Mon, 11 Mar 2024 15:48:02 +0100) References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Cc: joaotavora@gmail.com, 69241@debbugs.gnu.org > Date: Mon, 11 Mar 2024 15:48:02 +0100 > > Eli Zaretskii writes: > > > Can't the code activate the timers in reverse order? Then each > > timer--activate will likely compare with just one timer, the first > > one. > > In my patch they do. As all timers are using the same time list and > pushed on timer-list in the correct order. Feels like *I* have pushed > this thread into bikeshedding territory :) Maybe. But then why we are talking about N^2 order, if you already have a way to fix that? > > Timers must fire in the order of their time, so they must be kept > > sorted, or else running the timer functions and removing the timer > > from the list will be much more complex. > > > > Assuming that timers are sorted is not relying on the internals, if > > you ask me. > > Great, what actions do I need to take to move forward with this > maintainership thing? It's basically up to you, but maybe I don't understand what you are asking. From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 19:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171018384920077 (code B ref 69241); Mon, 11 Mar 2024 19:05:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 19:04:09 +0000 Received: from localhost ([127.0.0.1]:41313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjkwT-0005Dl-EW for submit@debbugs.gnu.org; Mon, 11 Mar 2024 15:04:09 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:43222) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjkwO-0005DA-Br for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 15:04:08 -0400 Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-51331634948so5194624e87.0 for <69241@debbugs.gnu.org>; Mon, 11 Mar 2024 12:03:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710183804; x=1710788604; h=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=kK4KYjFfvpMEMbtPVbS3OzvazK5PI807pAZ+ctLIjSI=; b=cWxNVgRfeDxfGktNaEggawyN9o1eU2UN9xzWs87vtgirW4NwVnuZQcc8ZhKE4n2ryj s5jZejSM5LFjmk17Y5si3AnE5Y47SBy1B21LAJN7hneTLe309sudSZ16XtMgxjlwuy4k upNOa+1OqyrMpG6w3h4v7doMkEg9EwN83DSZhZae4MUVAH97FROARwLiuL1B783E32d6 Rb9z+4TN8dXm8fAAAHkoNuoNsrRjPx+bqZH2YCBf7DVOxz7luwbeg+DkzoTbbIzpSL+P li/uspM8aP1kCLtQUekKCz1si+lMTd7L1CKk3s8rLmiAGntehQrJtrSefU6yvmOUv8ri Ab7g== X-Forwarded-Encrypted: i=1; AJvYcCUvE0a2klvP707Yu5onmgyO1l9JiW9zSZ+GrMVqokOLIdcjO7NNFj4uD89JX9bxUD7w9I3Zf/GNc2jsmZrJViZhAumq84M= X-Gm-Message-State: AOJu0Yz8z6WjHT9WmxM7Mn6rZXioUxPsXL0ZhYswkdUJbQOz+iWMYcbM KhO4qRdmW53IpD7O8yh8yCZkZEcXJZG/v6+a7FEL9IyBZpvBpvu+9+UvnkWt X-Google-Smtp-Source: AGHT+IF3GFfbe9P0AnmkjBIaptpyIk2iVry7FHdj3jaflFj8SMHWUk7t+dCCYeNipqVmRIjuMrNXnw== X-Received: by 2002:a05:6512:1c5:b0:513:4965:8d4e with SMTP id f5-20020a05651201c500b0051349658d4emr2741912lfp.26.1710183803937; Mon, 11 Mar 2024 12:03:23 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id eo6-20020a056512480600b005135b81f30asm1211110lfb.97.2024.03.11.12.03.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 12:03:23 -0700 (PDT) From: Daniel Pettersson In-Reply-To: <864jdcvin6.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Mar 2024 18:27:09 +0200") References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> Date: Mon, 11 Mar 2024 20:03:22 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.8 (/) Eli Zaretskii writes: > Maybe. But then why we are talking about N^2 order, if you already > have a way to fix that? It's in the first reply to this bug. I believe we got sidetracked. > It's basically up to you, but maybe I don't understand what you are > asking. I am up for it, I thought that maybe some actions need to be taken on my end to get that process rolling (getting push permission etc.). /Daniel From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 19:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171018488721855 (code B ref 69241); Mon, 11 Mar 2024 19:22:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 19:21:27 +0000 Received: from localhost ([127.0.0.1]:41318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjlDD-0005gR-67 for submit@debbugs.gnu.org; Mon, 11 Mar 2024 15:21:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37328) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjlDA-0005g9-3y for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 15:21:25 -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 1rjlAP-0001Ag-HF; Mon, 11 Mar 2024 15:18:33 -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=Qyd1yyHGf30ryzXUaFCfzmvgIk1Mvs8GLQX2pWXdQLs=; b=lYki3D7e/xFF XkxqWSfpaPbG7RgXFwPVOeOiueupVZYUBL9WW0IQ8ksuqYKhk4UqhojKKza8j05Eqlmsr57wVVv/Q +yxw9vSTkCmZ8E01sz2rlyrG3ijAS9XRVbEDo46jNiIh5i7k8jmyid9kPZSzYP45ZhdNMhn47gVS4 5Vctuz+RjmMxhT7puvEpytdIAm+e6JY4dqzsaepJXaem08mjdfkpVd9/mDVV4Fj7J9hzkWyoEQdw5 +Kmo+4o6aie9TaKgmHQz+OW0vEO/0Bie/KSItG51FEgHlUHuQgd8cViPqdOf2BA3RUHCMdEa++uJJ A3fA49CMy2iPXC8+bkoM5A==; Date: Mon, 11 Mar 2024 21:18:30 +0200 Message-Id: <86wmq8tw55.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Mon, 11 Mar 2024 20:03:22 +0100) References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Cc: joaotavora@gmail.com, 69241@debbugs.gnu.org > Date: Mon, 11 Mar 2024 20:03:22 +0100 > > > It's basically up to you, but maybe I don't understand what you are > > asking. > > I am up for it, I thought that maybe some actions need to be taken on my > end to get that process rolling (getting push permission etc.). Write access to the repository is a separate decision. We usually make it after observing your patches and review comments to them over some period, to make sure you are on top of our conventions and procedures. So no need to wait for that or see it as a prerequisite for your development and maintenance work. Thanks. From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 11 Mar 2024 19:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171018600423865 (code B ref 69241); Mon, 11 Mar 2024 19:41:02 +0000 Received: (at 69241) by debbugs.gnu.org; 11 Mar 2024 19:40:04 +0000 Received: from localhost ([127.0.0.1]:41333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjlVD-0006Cq-UK for submit@debbugs.gnu.org; Mon, 11 Mar 2024 15:40:04 -0400 Received: from mail-lf1-f51.google.com ([209.85.167.51]:54779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjlVA-0006CG-3r for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 15:40:01 -0400 Received: by mail-lf1-f51.google.com with SMTP id 2adb3069b0e04-5131c0691feso6142480e87.1 for <69241@debbugs.gnu.org>; Mon, 11 Mar 2024 12:39:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710185960; x=1710790760; h=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=H7JoC2C9yKL5IEK9F7EzO2fxal2hQQHTEseFJeSBuSU=; b=UbZ4GLRXwfxEMIVF4aVK6g3gSQoGmG9fgD3raAWlh5cN2Zgb2jcZ9lBjXbToZ6SJ+B rYVv9DPBF9GY0iC7tS4oMpNMp58iQltrSeD6/gUoigwpOPAU/XWZVz95QOuEYEKmQzRN SKAh3sVnpntPm5rT4E1M7ixWdluwXOIjxT/Iwyt6XEGJ4ozBfvOikQ+XpAvKc25jhopC AaeOaE2X+MQF5JrWLF76aUweQnyF73sHhxW9SD4S2VhwUuunFdlqVrSg/pwZheWEnbhS 6GJQjnib4vRL5HqqsjkGi87tZXdyuK9YOd1B68grNnZlbe5GwuTuxKLnsuip/u+LwMGM Biew== X-Forwarded-Encrypted: i=1; AJvYcCU17Umu4rXlOy77BMwLQl//ZKOtit7FUOxtcm8bfaHZIGeYiKB9jfdG3wtOEz1Dein4TcbeYp7dWRJjLrM7uCAjj/Xi868= X-Gm-Message-State: AOJu0Yxu2VoBNEK/m7vgwiZUWZ9+DUfRtzPKk3Z/Z+rvQEDVF2ZuMR05 QZ3wKg1XCZV0a+p6YwXXmUIgkj9QLHTXMI1bTeqb0yd8AycgpC0lXUM+vBrO X-Google-Smtp-Source: AGHT+IG4vVQ0W7AsIJtGgxcmbuRcnKhT4gG1CkuAUwTytZC54LOFUDNje55QfW7HW6383bfn0zeYag== X-Received: by 2002:ac2:4e08:0:b0:513:1551:e6 with SMTP id e8-20020ac24e08000000b00513155100e6mr6092886lfr.50.1710185959854; Mon, 11 Mar 2024 12:39:19 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id n23-20020ac242d7000000b005131b423d80sm1208926lfl.160.2024.03.11.12.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 12:39:19 -0700 (PDT) From: Daniel Pettersson In-Reply-To: <86wmq8tw55.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 11 Mar 2024 21:18:30 +0200") References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> <86wmq8tw55.fsf@gnu.org> Date: Mon, 11 Mar 2024 20:39:18 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.2 (/) 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.8 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Write access to the repository is a separate decision. We usually > make it after observing your patches and review comments to them over > some period, to make sure you are on top of our conventions and > procedures. So no need to wait for that or see it as a prerequisite > for your development and maintenance work. That makes sense, actually I appreciate the hand holding :) Is there any thing more that you need from me regarding the original issue? I feel like I have a decent enough understanding of Jsonrpc so I am happy to be noted as an maintainer contact in admin/MAINTAINERS. Also I am a bit bad at reading tones in email form. I am sorry if I made any faux pas in this thread. Re attaching the patch as to not get it confused with the first patch sent. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Jsonrpc-improve-performance-of-process-filter-functi.patch Content-Transfer-Encoding: quoted-printable Content-Description: PATCH >From c4d5ddb9ce5cdb8c283928daf6b166e4ce5a430d Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Wed, 28 Feb 2024 13:03:56 +0100 Subject: [PATCH] Jsonrpc: improve performance of process filter function `run-at-time' keeps `timer-list' list sorted by inserting each timer based on the timer value. This means that `timer--time-less-p' needs is executed ~ N*N/2 times for each N pending messages. This means that jsonrpc becomes unusable for connections that generate a lot messages at the same time. * lisp/jsonrpc.el (Version): Bump to 1.0.25 (jsonrpc--process-filter): Improve performance --- lisp/jsonrpc.el | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 14fe0447008..5037d8c5b2b 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ =20 ;; Author: Jo=C3=A3o T=C3=A1vora ;; Keywords: processes, languages, extensions -;; Version: 1.0.24 +;; Version: 1.0.25 ;; Package-Requires: ((emacs "25.2")) =20 ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -760,10 +760,11 @@ jsonrpc--process-filter (setq message (plist-put message :jsonrpc-json (buffer-string))) - (process-put proc 'jsonrpc-mqueue - (nconc (process-get proc - 'jsonrpc-= mqueue) - (list message))))) + ;; Put new messages at the front of the qu= eue, + ;; this is correct as the order is reversed + ;; before putting the timers on `timer-lis= t'. + (push message + (process-get proc 'jsonrpc-mqueue)))) (goto-char message-end) (let ((inhibit-read-only t)) (delete-region (point-min) (point))) @@ -782,11 +783,20 @@ jsonrpc--process-filter ;; non-locally (typically the reply to a request), so do ;; this all this processing in top-level loops timer. (cl-loop + ;; `timer-activate' orders timers by time, which is an + ;; very expensive operation when jsonrpc-mqueue is large, + ;; therefore the time object is reused for each timer + ;; created. + with time =3D (current-time) for msg =3D (pop (process-get proc 'jsonrpc-mqueue)) while msg - do (run-at-time 0 nil - (lambda (m) (with-temp-buffer - (jsonrpc-connection-receive conn = m))) - msg))))))) + do (let ((timer (timer-create))) + (timer-set-time timer time) + (timer-set-function timer + (lambda (conn msg) + (with-temp-buffer + (jsonrpc-connection-receive conn m= sg))) + (list conn msg)) + (timer-activate timer)))))))) =20 (defun jsonrpc--remove (conn id &optional deferred-spec) "Cancel CONN's continuations for ID, including its timer, if it exists. --=20 2.39.3 (Apple Git-145) --=-=-=-- From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Mar 2024 03:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.17102142459808 (code B ref 69241); Tue, 12 Mar 2024 03:31:01 +0000 Received: (at 69241) by debbugs.gnu.org; 12 Mar 2024 03:30:45 +0000 Received: from localhost ([127.0.0.1]:41545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjsqi-0002Y8-JP for submit@debbugs.gnu.org; Mon, 11 Mar 2024 23:30:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjsqe-0002Xq-6a for 69241@debbugs.gnu.org; Mon, 11 Mar 2024 23:30:43 -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 1rjsnu-00029e-Ll; Mon, 11 Mar 2024 23:27:50 -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=XXjWkRhI3YRpMBGR7prSl3XIRD2UbeOs+T9l0aIr4lw=; b=VJA9UojZxCV7 n5YP7lWmBaV/aKLuNQPOtQMDHayDt7i18tvzJ0GSbKATAo+D/YneKPfNauUmCRwQjJ2iRbHeLZdHh mBPe3k035odABwRw/mzJNe5w6y2AfOqiKRctAhqovhDQu7Nn0NpTbTAFEhnazVEnfMw7hiRmghywX TFEj9tbAHrLwYj5SbrIr67Q0qVeqhKafLUDAuBKZD765SfJA65jQ/3UdPB2dg4dumi+TdbS5U1+f6 WSceXB+FPnjjrLVpBJk5VC2agT4G0ek4+wMVl1OgJfgXdHwKnh3FqodfIRcHM8Rn5JxiKRKAx5fL0 /KIcUZdJOzL+uhqRG92p/A==; Date: Tue, 12 Mar 2024 05:27:48 +0200 Message-Id: <86v85st9hn.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Mon, 11 Mar 2024 20:39:18 +0100) References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> <86wmq8tw55.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Cc: joaotavora@gmail.com, 69241@debbugs.gnu.org > Date: Mon, 11 Mar 2024 20:39:18 +0100 > > Eli Zaretskii writes: > > > Write access to the repository is a separate decision. We usually > > make it after observing your patches and review comments to them over > > some period, to make sure you are on top of our conventions and > > procedures. So no need to wait for that or see it as a prerequisite > > for your development and maintenance work. > > That makes sense, actually I appreciate the hand holding :) Is there any > thing more that you need from me regarding the original issue? I feel > like I have a decent enough understanding of Jsonrpc so I am happy to be > noted as an maintainer contact in admin/MAINTAINERS. I have all the information I need, and will make the change soon. > Also I am a bit bad at reading tones in email form. I am sorry if I > made any faux pas in this thread. You didn't, no worries. > Re attaching the patch as to not get it confused with the first patch sent. Thanks, will install soon. From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Mar 2024 13:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Daniel Pettersson Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171025018322593 (code B ref 69241); Tue, 12 Mar 2024 13:30:03 +0000 Received: (at 69241) by debbugs.gnu.org; 12 Mar 2024 13:29:43 +0000 Received: from localhost ([127.0.0.1]:42070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk2CM-0005sL-Kt for submit@debbugs.gnu.org; Tue, 12 Mar 2024 09:29:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk2CG-0005s3-Pr for 69241@debbugs.gnu.org; Tue, 12 Mar 2024 09:29:40 -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 1rk2Bc-0000xA-JZ; Tue, 12 Mar 2024 09:28:56 -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=xdIxc9VhFvgVdsZ5+1LoPX5eKE+ytux/VFARWtaLbVg=; b=TbAy1Kk2klT1 C7rD22z6lFKVAUz4tQhBYvvDDp/lDwoYw1SvXySaV2guXn/796xQlVX0BlZV/EzXZ1lzGj39QcP7G Ou6rBa5Cws6sa4YxhxzAB/jgDSLNQGEHHLV9ICQRYBrEjkt0WOIHweXYwYZVhpoKxFnlE0L6f0S4V n00+IDqCFx8/hKvL7Za25FBntwguALYOfEjV1WzTy5L7Z4+bFn9k6LQZXWEJh65MK+PcVeZ4HB0n4 3owMYCrcaA11wAEiWmFDoNFXpC/SNMhEnk8qru/JLpgpUOLGproWFwQV+SAvfByxkP8jTYJBJltKU 94I9D2REwswynZvx41b3ug==; Date: Tue, 12 Mar 2024 15:28:52 +0200 Message-Id: <86sf0vtw8b.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: (message from Daniel Pettersson on Mon, 11 Mar 2024 20:39:18 +0100) References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> <86wmq8tw55.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: Daniel Pettersson > Cc: joaotavora@gmail.com, 69241@debbugs.gnu.org > Date: Mon, 11 Mar 2024 20:39:18 +0100 > > Re attaching the patch as to not get it confused with the first patch sent. Thanks, installed on the master branch. A few nits for the future: . Please make sure the lines in the commit log message are wrapped at column 65 at most, so that the generated ChangeLog file, which indents the entries by a TAB, has lines wrapped at 74 columns. . Each log entry should end in a period, i.e. be a complete sentence. . Please always mention the bug number, if known, as part of the commit log messages. From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Mar 2024 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: daniel@dpettersson.net Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.171025037722993 (code B ref 69241); Tue, 12 Mar 2024 13:33:02 +0000 Received: (at 69241) by debbugs.gnu.org; 12 Mar 2024 13:32:57 +0000 Received: from localhost ([127.0.0.1]:42088 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk2FU-0005yn-Nw for submit@debbugs.gnu.org; Tue, 12 Mar 2024 09:32:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52180) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk2FS-0005yZ-2m for 69241@debbugs.gnu.org; Tue, 12 Mar 2024 09:32:54 -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 1rk2Eo-0002B9-0Q; Tue, 12 Mar 2024 09:32:14 -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=fhNGgRU0I570aSz24ZiYgsJ+OFyp1EZBzEmP6ejFhFY=; b=d+9Je4fhoCUn B4nNeXHX6/MH7nITnbH+C7YjHjSAsuSt7ESH7Wd3UvE2TiV2ZMSP50DdJsdZxe87sSpTtogyju4bH lxHNrqvnaVikoJsZObmCaNHY23mJJBVf8bImU9xwZPAEPtOLGnBodxvLfgABUVsuPeAgO9Z+OXHjQ sqNIc9oUQS3u/Y66rVG4nWeGuORutT1lmg5LotQs8DyXx2BmYHeH+on0RFW5UQVSusXmlgsiYurAu L85Eq8kcA2nf0wGXGz21izZCgmM8dkNlmQ0Flqvm69hMQ2h2IL4dqIk5Icl7XD85KL8jdKO3JXLMG wKB6kNgqmeJEKR9N7dgEkw==; Date: Tue, 12 Mar 2024 15:31:50 +0200 Message-Id: <86r0gftw3d.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <86v85st9hn.fsf@gnu.org> (message from Eli Zaretskii on Tue, 12 Mar 2024 05:27:48 +0200) References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> <86wmq8tw55.fsf@gnu.org> <86v85st9hn.fsf@gnu.org> X-Spam-Score: -2.3 (--) 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: 69241@debbugs.gnu.org, joaotavora@gmail.com > Date: Tue, 12 Mar 2024 05:27:48 +0200 > From: Eli Zaretskii > > > From: Daniel Pettersson > > Cc: joaotavora@gmail.com, 69241@debbugs.gnu.org > > Date: Mon, 11 Mar 2024 20:39:18 +0100 > > > > Eli Zaretskii writes: > > > > > Write access to the repository is a separate decision. We usually > > > make it after observing your patches and review comments to them over > > > some period, to make sure you are on top of our conventions and > > > procedures. So no need to wait for that or see it as a prerequisite > > > for your development and maintenance work. > > > > That makes sense, actually I appreciate the hand holding :) Is there any > > thing more that you need from me regarding the original issue? I feel > > like I have a decent enough understanding of Jsonrpc so I am happy to be > > noted as an maintainer contact in admin/MAINTAINERS. > > I have all the information I need, and will make the change soon. Done. > > Re attaching the patch as to not get it confused with the first patch sent. > > Thanks, will install soon. And done. Should we close this bug now? From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Mar 2024 14:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.17102540328762 (code B ref 69241); Tue, 12 Mar 2024 14:34:01 +0000 Received: (at 69241) by debbugs.gnu.org; 12 Mar 2024 14:33:52 +0000 Received: from localhost ([127.0.0.1]:43332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3CR-0002HG-UQ for submit@debbugs.gnu.org; Tue, 12 Mar 2024 10:33:52 -0400 Received: from mail-lj1-f175.google.com ([209.85.208.175]:47191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3CQ-0002H0-CH for 69241@debbugs.gnu.org; Tue, 12 Mar 2024 10:33:51 -0400 Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2d4541bf57eso11038391fa.2 for <69241@debbugs.gnu.org>; Tue, 12 Mar 2024 07:33:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710253990; x=1710858790; h=mime-version:user-agent:date:references:message-id:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=q/mkpQlOlqe4baluHM/oASIhifKuIvKbb/1OSC+bg6g=; b=TclxWDFWlb7Cbito14Tb9pOWYkPyjPW0WGPjlokpo/9PChEKZAfiI8A/zAC1K3GtRp OHJvthLWAQnJCC7F58dFIQ0NvgqLExNnaNxHxlKpIV2F9FxepfmvRqzPA44ywQp5Zt0j YqU5E+BYMPkOKUMO14++dzXeo0Khuqp+bzzKu45FFRs1BuNHOCtetRP2SwSv/2c0tWgG IlLVaLd3M0jlUq+y1HU2gEfhnLY2HeE/EslWgNLgdHcICNklS+15qhyDaJ/A3igcrShI SVw6+63mUQP7WXVlwiRG2MslJ6iMSCQMHl+Jq2C19tDLe2wZFCVkDXG9rvA1pAoVynzM NyWg== X-Forwarded-Encrypted: i=1; AJvYcCUzdd09mgkiMBiHJqPpMtJpsimWqEzwD+jhcxRfJ56aejxvfW/ZDGzPvnvmwrI2rBLILjH9tStBOPHqbL3bDcdJPJ3SCMU= X-Gm-Message-State: AOJu0Yw0T2rkYl8m6CThfjVe1tzDE1wqDX8zJKdym1049v6NwfC4EhfM vuwAsuYES0Nr1DlcJu+01T6+MppUFTZwLs8RKIuSwTuQsryT/+Ddw6Bqai3a X-Google-Smtp-Source: AGHT+IGhYM32LPu+fmeuubbzZQe9eiIljwhu4r/GhwQ8Bmuhtff4W7EiDhKwNJdyZotJok2jXgjXxw== X-Received: by 2002:a2e:6a14:0:b0:2d2:4783:872a with SMTP id f20-20020a2e6a14000000b002d24783872amr490052ljc.29.1710253989744; Tue, 12 Mar 2024 07:33:09 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id n6-20020a2e8786000000b002d292045211sm1638555lji.132.2024.03.12.07.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:33:09 -0700 (PDT) From: Daniel Pettersson In-Reply-To: <86sf0vtw8b.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 12 Mar 2024 15:28:52 +0200") Message-ID: References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> <86wmq8tw55.fsf@gnu.org> <86sf0vtw8b.fsf@gnu.org> Date: Tue, 12 Mar 2024 15:33:08 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.8 (/) Eli Zaretskii writes: > Thanks, installed on the master branch. Great, thanks! > A few nits for the future: > > . Please make sure the lines in the commit log message are wrapped at > column 65 at most, so that the generated ChangeLog file, which > indents the entries by a TAB, has lines wrapped at 74 columns. > . Each log entry should end in a period, i.e. be a complete sentence. > . Please always mention the bug number, if known, as part of the > commit log messages. Will do better in next patch, thanks again. /Daniel From unknown Sun Jun 22 00:38:15 2025 X-Loop: help-debbugs@gnu.org Subject: bug#69241: Fixed patch issues Resent-From: Daniel Pettersson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 12 Mar 2024 14:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69241 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com Received: via spool by 69241-submit@debbugs.gnu.org id=B69241.17102541048938 (code B ref 69241); Tue, 12 Mar 2024 14:36:02 +0000 Received: (at 69241) by debbugs.gnu.org; 12 Mar 2024 14:35:04 +0000 Received: from localhost ([127.0.0.1]:43337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3Dc-0002K6-BJ for submit@debbugs.gnu.org; Tue, 12 Mar 2024 10:35:04 -0400 Received: from mail-lf1-f52.google.com ([209.85.167.52]:44258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3DZ-0002JW-UF for 69241@debbugs.gnu.org; Tue, 12 Mar 2024 10:35:02 -0400 Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-5131316693cso7534724e87.0 for <69241@debbugs.gnu.org>; Tue, 12 Mar 2024 07:34:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710254061; x=1710858861; h=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=CH8BLFSCP73H/wEGcUXt2f2vdiiHjSgG64I8CCbq9gE=; b=rayK39O5LpHPnIIkTVdGmDWqWTe+aesulIyKlbN8m+Hq7BJJeVgOg/wDt5Z5bAmxcB UeOjbPm5I26rqV1QRXoDuBntag2LUucODRFBUJBdr+wCIhHhZ5nE2GvJd5h1ui12B6GA pqKcVOdvR5YUgyl9ZBR0y4qjqGHxZ3x9E+/PlghB+UPnyxoN1gHdmsv3Swi3NhlXpsuc gLtOlCYSWxQMkMVu8R/TAFriKsjr+ZCkFjWItXKnzGH4mvQRrMtGMepczZ5eqNMMqd2e CFyRwYFsEQYkm1H70SQGU0Gvk1uisZ61Qxp1EHR3fArbXQ0ESohRIYfdKBiXWqaZuR07 neAQ== X-Gm-Message-State: AOJu0YzgBncw5YdGspX22u70FrOWE62uIoh7Tb8wC9/shLQVpXWcoXib wq9XL1+U+HSCbppuwjdQCZbsXZOEVFpqu0UX4eNadnh6HqwHtjkv X-Google-Smtp-Source: AGHT+IE1/CPsdFvxEShZSr54/kug5tLWjV9s7paFa9yc+JB0Ff6Ar5i6ES/+niNXlqk69ykrpeLLKg== X-Received: by 2002:a19:ad45:0:b0:513:c327:212f with SMTP id s5-20020a19ad45000000b00513c327212fmr792886lfd.19.1710254061392; Tue, 12 Mar 2024 07:34:21 -0700 (PDT) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id m3-20020a05651202e300b0051327cb3a77sm1595529lfq.247.2024.03.12.07.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:34:21 -0700 (PDT) From: Daniel Pettersson In-Reply-To: <86r0gftw3d.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 12 Mar 2024 15:31:50 +0200") References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> <86wmq8tw55.fsf@gnu.org> <86v85st9hn.fsf@gnu.org> <86r0gftw3d.fsf@gnu.org> Date: Tue, 12 Mar 2024 15:34:20 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.2 (/) 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.8 (/) Eli Zaretskii writes: > Should we close this bug now? Yes /Daniel From unknown Sun Jun 22 00:38:15 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Daniel Pettersson Subject: bug#69241: closed (Re: bug#69241: Fixed patch issues) Message-ID: References: <86jzm7trzp.fsf@gnu.org> X-Gnu-PR-Message: they-closed 69241 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 69241@debbugs.gnu.org Date: Tue, 12 Mar 2024 15:02:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1710255722-12627-1" This is a multi-part message in MIME format... ------------=_1710255722-12627-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #69241: [PATCH] Jsonrpc: improve performance of process filter function which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 69241@debbugs.gnu.org. --=20 69241: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D69241 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1710255722-12627-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 69241-done) by debbugs.gnu.org; 12 Mar 2024 15:01:16 +0000 Received: from localhost ([127.0.0.1]:43369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3cy-0003GP-II for submit@debbugs.gnu.org; Tue, 12 Mar 2024 11:01:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rk3cu-0003GA-Vb for 69241-done@debbugs.gnu.org; Tue, 12 Mar 2024 11:01:14 -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 1rk3cG-0003a8-6Q; Tue, 12 Mar 2024 11:00:32 -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=lqXOVZLs6V0Jjt680zZc06mL7I4Y7KzvCrbUSrK8IrU=; b=geqW1+BOmwzW k2/K+qHU2Sq+Ic2T0HYHKDodDhef6qIpB3G8dR7czz9lSOwD2+7quiyRSmlyafb8KyCIY0cZf7Kem pKc1Pcqcvc8FiQocjHbKsJFh1BkK8gZUfZsz0DgVGe/S358Iyxkmonb8EqYin3nUX7We2mBG6UFEu ILmI3yaK9pi65VBHbcMmHZYZmCMUuAqUePW8/jz7TaP3VLWzF8uYTGyf910gs8aKOX3BVxFqAIAxD 2TAKYv4ABthdCi4T3B9EzwAftM7aekeB9yOWxFfGUk6dpLkp5FLJUK0dMfTRofDHWkWm7PUmZ27Oh LRvBOC/fVU5MPJEcx3ExJw==; Date: Tue, 12 Mar 2024 17:00:26 +0200 Message-Id: <86jzm7trzp.fsf@gnu.org> From: Eli Zaretskii To: Daniel Pettersson In-Reply-To: (message from Daniel Pettersson on Tue, 12 Mar 2024 15:34:20 +0100) Subject: Re: bug#69241: Fixed patch issues References: <86msr7ye9h.fsf@gnu.org> <86edcgvrp1.fsf@gnu.org> <864jdcvin6.fsf@gnu.org> <86wmq8tw55.fsf@gnu.org> <86v85st9hn.fsf@gnu.org> <86r0gftw3d.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 69241-done Cc: 69241-done@debbugs.gnu.org, 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: -3.3 (---) > From: Daniel Pettersson > Cc: 69241@debbugs.gnu.org, joaotavora@gmail.com > Date: Tue, 12 Mar 2024 15:34:20 +0100 > > Eli Zaretskii writes: > > > Should we close this bug now? > > Yes Thanks, done. ------------=_1710255722-12627-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 18 Feb 2024 18:25:03 +0000 Received: from localhost ([127.0.0.1]:37429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblqZ-0003Sy-45 for submit@debbugs.gnu.org; Sun, 18 Feb 2024 13:25:03 -0500 Received: from lists.gnu.org ([209.51.188.17]:44974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rblNj-0001bb-T0 for submit@debbugs.gnu.org; Sun, 18 Feb 2024 12:55:16 -0500 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 1rbWMd-00087O-9H for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 20:53:07 -0500 Received: from mail-lj1-f174.google.com ([209.85.208.174]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rbWMa-0006zc-U4 for bug-gnu-emacs@gnu.org; Sat, 17 Feb 2024 20:53:06 -0500 Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2d10ad265d5so27777661fa.0 for ; Sat, 17 Feb 2024 17:53:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708221182; x=1708825982; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=A1iDhSOPUhTKsXKHlUuLnJ2UCro9NsKfr5qT66UqHO8=; b=sj42aG/rIasHCIkk7onH/GLgZk8U6RAzFHTFUSqqtYDKlu9EsphM7lmxWoI5qh/+c/ iy4XoBZW3M7fNYg6UjnTu4nw9x3as9fG0Ugjqm8BUisAAUIagN7vtvdGtYlSBv9M2tfK EEju6zV+l/ZpyoZPRlnor3FXgLYrYHfE3oO3NLx+3vboFUWgrdoQJHrBaFhAXZUnfsmM ZbR+g4W38B+PAVO9lN0lOrsC5uOfvOaEzApAJuZf+kG5YJzqRl8mq8HfT6KDgGfbdUiw loQ4DAVPu3o/2oprkub3d1RGOp/H5TjdKOtMDqM6SZ7+pFgQSm2KXXA+sMGSIGvWFj2Q f58Q== X-Gm-Message-State: AOJu0Yz+Cvcuiz1uhd1nlTVQXXUDPA6OK0TyuncoXUZD1tMXAPSda1VT NzuY5IYwHVtkGnmEcWAHtiVR+o1+rXtAxzPBdqzdYYhDyEVClFSYaOhDBNyb X-Google-Smtp-Source: AGHT+IHBFgJyX6OIJgTaoMXCxR1e2c0DTflOIXhwBFZvShveM9chgl1DJvjBpa5Wijalq0gu1VUhoQ== X-Received: by 2002:a2e:9217:0:b0:2d0:dfa6:2b3f with SMTP id k23-20020a2e9217000000b002d0dfa62b3fmr6509093ljg.1.1708221182368; Sat, 17 Feb 2024 17:53:02 -0800 (PST) Received: from Daniels-Air (c-72cde455.027-357-6d6c6d4.bbcust.telenor.se. [85.228.205.114]) by smtp.gmail.com with ESMTPSA id v8-20020a2e9248000000b002d06c31cf6esm506104ljg.124.2024.02.17.17.53.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 17:53:01 -0800 (PST) From: Daniel Pettersson To: bug-gnu-emacs@gnu.org Subject: [PATCH] Jsonrpc: improve performance of process filter function Date: Sun, 18 Feb 2024 02:53:01 +0100 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=209.85.208.174; envelope-from=daniel.dpettersson.net@gmail.com; helo=mail-lj1-f174.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -3.3 (---) X-Debbugs-Envelope-To: submit 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: -4.3 (----) --=-=-= Content-Type: text/plain Tags: patch This was issue was discovered during elpa package dape's development, where an adapter was sending 72000 notifications on startup which leads to emacs looping over timer--time-less-p for > 50 seconds and after the fix for less then 1 second. The "integrity" of timer order are messed with but as timer_check runs all of the ripe timers in the same while loop it only becomes an question of execution order. This change uses timer.el internal api `timer--triggered', but this might be fine as it's tightly coupled with keyboard. In GNU Emacs 30.0.50 (build 1, aarch64-apple-darwin23.1.0, NS appkit-2487.20 Version 14.1.1 (Build 23B81)) of 2023-12-20 built on Daniels-Air Repository revision: 281be72422f42fcc84d43f50723a3e91b7d03cbc Repository branch: master Windowing system distributor 'Apple', version 10.3.2487 System Description: macOS 14.1.1 --=-=-= Content-Type: text/patch; charset=utf-8 Content-Disposition: attachment; filename=0001-Jsonrpc-improve-performance-of-process-filter-functi.patch Content-Transfer-Encoding: quoted-printable >From 92eef1a5221dd69dc95a9484eafeacad571246f8 Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Sun, 18 Feb 2024 02:05:46 +0100 Subject: [PATCH] Jsonrpc: improve performance of process filter function `run-at-time' keeps `timer-list' list sorted by inserting each timer based on the timer value. This means that `timer--time-less-p' needs is executed ~ N*N/2 times for each N pending messages. This means that jsonrpc becomes unusable for connections that generate a lot messages at the same time. * lisp/jsonrpc.el (Version): Bump to 1.0.25 (jsonrpc--process-filter): Improve performance --- lisp/jsonrpc.el | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lisp/jsonrpc.el b/lisp/jsonrpc.el index 14fe0447008..9a52b5a76cf 100644 --- a/lisp/jsonrpc.el +++ b/lisp/jsonrpc.el @@ -4,7 +4,7 @@ =20 ;; Author: Jo=C3=A3o T=C3=A1vora ;; Keywords: processes, languages, extensions -;; Version: 1.0.24 +;; Version: 1.0.25 ;; Package-Requires: ((emacs "25.2")) =20 ;; This is a GNU ELPA :core package. Avoid functionality that is not @@ -782,11 +782,22 @@ jsonrpc--process-filter ;; non-locally (typically the reply to a request), so do ;; this all this processing in top-level loops timer. (cl-loop + with time =3D (timer-relative-time nil 0) for msg =3D (pop (process-get proc 'jsonrpc-mqueue)) while msg - do (run-at-time 0 nil - (lambda (m) (with-temp-buffer - (jsonrpc-connection-receive conn = m))) - msg))))))) + do (let ((timer (timer-create))) + (timer-set-time timer time) + (timer-set-function timer + (lambda (conn msg) + (with-temp-buffer + (jsonrpc-connection-receive conn m= sg))) + (list conn msg)) + (setf (timer--triggered timer) nil) + ;; We're bypassing `timer-activate' due to performance + ;; concerns. `timer-activate' iterates through all + ;; timers scheduled to execute before inserting our + ;; callback. While it doesn't maintain the precise + ;; order of timers, we should be fine. + (setf timer-list (cons timer timer-list))))))))) =20 (defun jsonrpc--remove (conn id &optional deferred-spec) "Cancel CONN's continuations for ID, including its timer, if it exists. --=20 2.39.3 (Apple Git-145) --=-=-=-- ------------=_1710255722-12627-1--