From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Gap buffer problem? Date: Wed, 11 Dec 2024 16:22:35 +0200 Message-ID: <867c8647v8.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18388"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, ofv@wanadoo.es, pipcet@protonmail.com To: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 11 15:23:57 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 1tLNd6-0004Zb-80 for ged-emacs-devel@m.gmane-mx.org; Wed, 11 Dec 2024 15:23:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLNbz-0000dn-8k; Wed, 11 Dec 2024 09:22:47 -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 1tLNbt-0000cg-9u for emacs-devel@gnu.org; Wed, 11 Dec 2024 09:22:42 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tLNbs-0008Iw-G2; Wed, 11 Dec 2024 09:22:40 -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=rsMDaZ9oObsO6GNc9P91ESNxs/PvvAjhkrO1sc9V/PA=; b=shJInJUi2VE0SO9RGwC+ E13nB1DrKOpOF7IPq780S/G1kLgCvYGen2mzfUAJ+MyrmONQaBLElkYWt2Yv5o5K3MAINn9Ys2ahD xFsCck0Hb1geMx1xBbJnHXqCcne4/h87ruHueylY/ZA8bXia0xSwoE1JnfX/XjUkmWgTQWNS0ec++ zAUfRq1a0HpRdmQ5Wij1iim6BX5H9zUuGog6G6dRAGBsucRCST6lQ3mEbE2vN41cpMjmjgeMYflNg hOMVC6QaUiVc+z9l3/xTjYjDKjFfFf8DqAbb7Q9uphQTKV0C0EI9HXbtHHnTlz3qbc7OVosN8XJXU xKqVT886jivnMA==; In-Reply-To: (message from Gerd =?utf-8?Q?M?= =?utf-8?Q?=C3=B6llmann?= on Wed, 11 Dec 2024 06:27:43 +0100) 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:326354 Archived-At: > From: Gerd Möllmann > Cc: Óscar Fuentes , Pip Cet > > Date: Wed, 11 Dec 2024 06:27:43 +0100 > > Pip Cet via "Emacs development discussions." > writes: > > > To be fair, part of that may be the gap buffer problem rather than GC. > > Could you please tell more about the gap buffer problem? > > 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. > > (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.