From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] add compiled regexp primitive lisp object Date: Wed, 07 Aug 2024 03:21:09 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5163"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "emacs-devel@gnu.org" , Eli Zaretskii To: Danny McClanahan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 07 09:22:20 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 1sbb00-0001D8-0p for ged-emacs-devel@m.gmane-mx.org; Wed, 07 Aug 2024 09:22:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sbayu-0004jo-Bb; Wed, 07 Aug 2024 03:21:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbays-0004jd-Ff for emacs-devel@gnu.org; Wed, 07 Aug 2024 03:21:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sbays-0006sE-5I; Wed, 07 Aug 2024 03:21:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=WXRoa0QkxewY6eSxFyDi4iRvCxwEYOdmW4AZeJAxNS4=; b=TMVtGtCKmBOPrNvEB3Cz VRJaH7Yr8CWLR6+p5KKJzb5jVhUsl3bxUAlTbdxC5dZf/WI1KWhNytOPvWkfxrEFifXmOBUhEAiQM sW7vDPc6dVW3CCJqWGusS0YTMdTi9nDl/87sKNyDf10Bc9gmfCqb9T+gcwFik7OXc8jB4XcPAQV8D 2DH87SmmcysioZU0LAXt17roFmSh00S/aDPtlKbM2IMQLBw4jlZrqN/v8E5Nb7mitH3mx/0VnVSX8 wuuyaM6nt+L0J8sicli2nxZm/KcP8B6i/f5X/VBG8BL0lpd5rl++/NZNaPhGYFh/crDtBwtexJ4gy tm+RBrk0Ic+Bpg==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sbayr-0007cA-P9; Wed, 07 Aug 2024 03:21:09 -0400 In-Reply-To: (Danny McClanahan's message of "Tue, 06 Aug 2024 13:47:13 +0000") 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:322481 Archived-At: Danny McClanahan writes: > Thank you so much for this comment Andrea. I apologize for missing it earlier, > I was harried from lack of sleep at the time. > >> On Thursday, August 1st, 2024 at 04:30, Andrea Corallo wrote: >> >> Hi Danny, >> >> IMO the idea is in principle interesting but: >> >> Can we prove there is some relistic usecase where we see performance >> improvements? Even if we can, maybe we can just improve the caching >> mechanism to better work? > > I have added benchmarks to test the feature (see > test/manual/regexp/regexp-perf.el in attached patch), but they are entirely > artificial to "show off" the feature. I'm not sure how jit-lock-mode works yet, > but I believe it uses `re-search-forward' and would likely see the most > benefit. I could also imagine some responsiveness improvements to comint-mode > and other modes that parse process output in a background buffer, especially as > they may be using different regexps than "user code" which processes editable > buffer text. > > I believe the ideal place to test this functionality on realistic use cases is > to see if it produces significant (hopefully user-visible -- if not, I have > strongly overestimated the need for this functionality) performance improvements > in jit-lock-mode. I'm not familiar with what kind of code parses process output > by regexp that cares enough about regexp performance to know of a realistic > benchmark to test that hypothesis. You could perhaps try with elisp-benchmarks [1], elb-scroll tests the scrolling of a font locked buffer, and elb-smie should benchmark the font locking of a buffer with sm-c-mode. Andrea [1]