From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Gap buffer problem? Date: Wed, 11 Dec 2024 16:51:56 +0100 Message-ID: References: <86a5d6f7bn.fsf@gnu.org> <871pyijctd.fsf@protonmail.com> <8634iyf257.fsf@gnu.org> <8634iwex8q.fsf@gnu.org> <86wmg7bso1.fsf@gnu.org> <87cyhzmzbp.fsf@telefonica.net> <867c8647v8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34175"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, ofv@wanadoo.es, pipcet@protonmail.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 11 16:52:52 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tLP1A-0008l7-D2 for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Dec 2024 16:52:52 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLP0Q-0002Ml-1I; Wed, 11 Dec 2024 10:52:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLP0K-0002MH-VC for emacs-devel@gnu.org; Wed, 11 Dec 2024 10:52:01 -0500 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tLP0J-0003jE-Dv; Wed, 11 Dec 2024 10:52:00 -0500 Original-Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-434a852bb6eso65943135e9.3; Wed, 11 Dec 2024 07:51:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733932317; x=1734537117; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ohv5DHwyI8uNUZdSCYzP+w9fpNaMBeBeWa5YbvXdD0k=; b=Kh31WGB3bKwOjvYmItvHJTJLs+p+wESmyrvHdEvTnjsVkov+0k6725G8gESgnLRkgh Fd9K1tp5Kbb59IdMDCw3oYMwAvZamIVJo8ComwkqkiMRRNs2RjObkunWeFzHLyC6SC/n gZNiCIVK4KgnWOWstZ92xXTUudGCAVMQdyxKHNpHzrA/B8zuX5sZeTiAi1V2JZmPVSyw 2PcXsPIhxoP0HyuhvCYhzoprpuCbTcbagau1TTt5k+aN4qb6LBloGTQwRjKuDpjLvW+L NDLXqSch8EF7SVp97IffeEJlUnRY4chKULb6pTGDVEE4Hmhsy/sKl5yyi89Ifjf/Db4v VUBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733932317; x=1734537117; 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=Ohv5DHwyI8uNUZdSCYzP+w9fpNaMBeBeWa5YbvXdD0k=; b=g42ZDtLn5zlnHsOEq5e9//f4vqgO5hzpcpwDkkiGs2Lkqw/0Ski++3k/YdfGsutCSC DamlXfGbmSZrifHcAORGFJpoeFKEuhZaDPMIFLqQuUj38c7FqmlzP06B6OMGRZ1S4zvk NWSc108eD3Nt/pyxmSdIsqCDrler/R2RUt7o6/MEjXAEuF99+Ys91oNT/Hb4xk01JPok 9fPWrWItNuWhwrvAU7ApvYbmNqVS3vaAVD3Wpl7T0wDKncpXn+lYGL7jpF7USEIhxTP5 kjRPt8okYE3GlFKFFny8YpRKGkzPWLvUTNJJ4FcBH0kC4sXo7tvFvjsg9DmieqK8xP5m pfsQ== X-Gm-Message-State: AOJu0Yy5OwA2yif3fymuv1LKs+xSuwc3FwcG26BHgeZ/T8rdNBr+D0Xv MEmCo7QucXL5EOZ5aV4CcxkZme+OPT6uDciNID1ZjS42bcZXFkPF X-Gm-Gg: ASbGncu3ELInVahoqWUg77qzV1w5E8KOGprspxCxNKh88UqJ7gp8sIUvFcUEE1xuWkK KLUZmOPsmxFQlK9h4xGbA9qtKOj5gGVsLmtEDhpTprgZ2tcvKXF+KcD/haBgXj9tLwZUVZhDhFG i4KiAMEL20rHTXalDIdhifRRf8OBXoqitRIwmjiw/f6OJaaU/cr5JI34N8fyxArH/aKt9YlPIpS Ld1YiwFnVnJRoiVu3Mtyq8pgEcfB7Ip5F/Xrv1hJA3B0B4vbu1t181BTocO35ZdsJ58wJmzLDhl OLAdeVAxc8CczcJXZTg4YIFeR/T9z2iYXSLxunhh9z/WLun5f6tqbeHDZlv4+j4= X-Google-Smtp-Source: AGHT+IE+RsxLjh3ad82wa8MwUMYtWi/x8gGdvW684jdWGWRof+fTgDZ30qfN84slsoT+DCVO/A4pWA== X-Received: by 2002:a05:6000:1449:b0:386:4034:f9a4 with SMTP id ffacd0b85a97d-3864cec3aafmr3192507f8f.43.1733932317445; Wed, 11 Dec 2024 07:51:57 -0800 (PST) Original-Received: from pro2 (p200300e0b709ba00c5d5596d9959c8a7.dip0.t-ipconnect.de. [2003:e0:b709:ba00:c5d5:596d:9959:c8a7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f44eaac7sm124721925e9.42.2024.12.11.07.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 07:51:57 -0800 (PST) In-Reply-To: <867c8647v8.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Dec 2024 16:22:35 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326365 Archived-At: Eli Zaretskii writes: >> From: Gerd M=C3=B6llmann >> Cc: =C3=93scar Fuentes , Pip Cet >> >> Date: Wed, 11 Dec 2024 06:27:43 +0100 >>=20 >> Pip Cet via "Emacs development discussions." >> writes: >>=20 >> > To be fair, part of that may be the gap buffer problem rather than GC. >>=20 >> Could you please tell more about the gap buffer problem? >>=20 >> I've read a little about the tradeoffs between gap buffers, piece >> tables, ropes, but I'm wondering if there is something concrete already >> known for sure that is a performance problem in Emacs. Maybe a bug that >> has been analyzed or something. >>=20 >> (I'm asking because I just recently encountered a performance problem >> when adding something to xdisp.c:27339 (with cc-mode, Eglot, Corfu), and >> editing there was so slow that it was absolutely no fun, and that on a >> an M1 pro. Haven't investigated the reason.) > > Unless you have a huge (and I mean a HUGE) buffer, and some Lisp that > moves point, then inserts a small number of characters, then moves > point far away and again inserts a small number of characters, etc., > I'd be very surprised if the gap buffer caused significant performance > problems on a modern CPU. > > Can you profile that case and post the expanded profile? I'm always > happy to be wrong about performance bottlenecks, and profiles are good > at proving me wrong. Maybe I'll try to investigate that further at some point. Such things always tend to be so time consuming...