From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#24048: 25.0.95; syntax-ppss can be slow Date: Fri, 03 Dec 2021 12:01:41 -0500 Message-ID: References: Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26659"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 24048@debbugs.gnu.org To: Aaron Jensen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 03 20:05:19 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mtDrz-0006mO-6J for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Dec 2021 20:05:19 +0100 Original-Received: from localhost ([::1]:36340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtDrx-0007QL-Oe for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Dec 2021 14:05:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtDri-0007Pw-Ut for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2021 14:05:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtDri-00013x-Na for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2021 14:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtDri-0000Of-FL for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2021 14:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Dec 2021 19:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24048 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 24048-submit@debbugs.gnu.org id=B24048.16385582671481 (code B ref 24048); Fri, 03 Dec 2021 19:05:02 +0000 Original-Received: (at 24048) by debbugs.gnu.org; 3 Dec 2021 19:04:27 +0000 Original-Received: from localhost ([127.0.0.1]:52233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtDr9-0000No-8G for submit@debbugs.gnu.org; Fri, 03 Dec 2021 14:04:27 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtDr5-0000NZ-L9 for 24048@debbugs.gnu.org; Fri, 03 Dec 2021 14:04:26 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AB86E806A3; Fri, 3 Dec 2021 14:04:17 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id D8C2E80043; Fri, 3 Dec 2021 14:04:15 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1638558255; bh=l+wWjeXt+emoeZul+4iPGYSa0QRimejQa/HxPIb/OeU=; h=From:To:Cc:Subject:In-Reply-To:Date:References:From; b=nNoiK4OiZH1AWucA51o6fuwpOKj/kwvn3n0PAFWt44YBTbLPAGyepgefmJmOuRB2p T61iJPtwTFZnJTkDtz1FXX9hTws80bVHidNfqicp6xfG7xDxxQOcDbB4rrA7H1yA8O o5SafX0fhW2yvozrb22IhOwdpHkS1AAzDz2yIcN85RoVdtffYbmnwFT/ctXsFmjrdL FPFVSxyCS0hmyEnGoLieKpvSbI7gbD8XcvQ27ifv+YWnN7YU32lF+ViLxMdtgyxH3q 0LxptzKddPhOiap2cN9vyZj1BWka67jgdHorfMv/VpixIqJ/4aOEPvbXnX7qIszNhT Xkl/oGOLxPGPA== Original-Received: from pastel (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id AC385120891; Fri, 3 Dec 2021 14:04:15 -0500 (EST) In-Reply-To: (Aaron Jensen's message of "Thu, 21 Jul 2016 07:29:19 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:221411 Archived-At: > In certain situations, the caching of syntax-ppss can seem to be > insufficient for good performance when syntax-ppss is invoked in > a tight loop. Yes, that's a known limitation. Most uses of `syntax-ppss` that need to call it in a tight loop move the call outside of the loop and then use `parse-partial-sexp` inside the loop (and they're careful to move forward so `parse-partial-sexp` is only called between the last position and the current one so we avoid re-parsing the same text). Currently `syntax-ppss` assumes that parsing <2500 chars is "fast enough" and hence that it's better not to update the "last ppss data" when this happens (the advantage is that we save time not-updating the data and we also save time if the next call is somewhere within those <2500 chars). Stefan