From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#24048: 25.0.95; syntax-ppss can be slow Date: Fri, 3 Dec 2021 20:31:50 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30045"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 24048@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 04 02:33:43 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 1mtJvr-0007h1-7V for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Dec 2021 02:33:43 +0100 Original-Received: from localhost ([::1]:51774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mtJvp-0000np-Gm for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Dec 2021 20:33:41 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtJvD-0000nd-HF for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2021 20:33:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40942) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtJvC-0007Er-DQ for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2021 20:33:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mtJvC-0003er-AQ for bug-gnu-emacs@gnu.org; Fri, 03 Dec 2021 20:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Dec 2021 01:33: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.163858153114000 (code B ref 24048); Sat, 04 Dec 2021 01:33:02 +0000 Original-Received: (at 24048) by debbugs.gnu.org; 4 Dec 2021 01:32:11 +0000 Original-Received: from localhost ([127.0.0.1]:52488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtJuM-0003dk-OS for submit@debbugs.gnu.org; Fri, 03 Dec 2021 20:32:11 -0500 Original-Received: from mail-pl1-f180.google.com ([209.85.214.180]:37587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtJuI-0003dB-UI for 24048@debbugs.gnu.org; Fri, 03 Dec 2021 20:32:08 -0500 Original-Received: by mail-pl1-f180.google.com with SMTP id n8so3273428plf.4 for <24048@debbugs.gnu.org>; Fri, 03 Dec 2021 17:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k9W4WFVzGMu5548GmYFhDkgqPdnegQoQh8bNkd+/B94=; b=ooCh3+ZjVJ50KjNaO2iyD3vLuqphxsOM6V3vgmpd1da5A5TFRnpyjn2iwKfvBR6nKm R2KqIPVp/qkdtydWD00Bsjnedhm+yQ5U0y5RDv6L6uX4Z9Zd2o1llEoL2Hdh/KCl7nwO joDE0u1T4KJZL1LD/6JwyBTWzoeHUBJCZzeABJod7C3OuemYxHie5WPgW5s/LOiZA6Xk jHjCzSf3sV2Hzpvb7cYj4oHx4p+QCMwOinGhGFf3wzQV1egGP7zW5t4qNvd6g2fFGRFZ 8aOr0mTrqTFBF/J2Z2v71OaDGnmx9m6ICL2cGgIOIgo2e6UuLIO+BY9qZbr5OEgVhvX+ 4yCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k9W4WFVzGMu5548GmYFhDkgqPdnegQoQh8bNkd+/B94=; b=fYgXHmKu01gr/GGZx8woltoG5xjipB/holfuNy1IR/J/lCuZ4q3A96aJ/sI8j0dPbz wqdjQ7hx5vzdZ+CcXYPyD8uUBPMyoJNCkpf6rw5DtNXSCG3KQ8XTtqSKKJ/AEMSteuAe rUV2s0D35XH1dz4SwmYG/Xmt21kHAeAOQVIgtHBbX4kL/KbjYCM3Lm/pCDQ0jHz1HOOx A6RemzmsbB2UROY2IptfOuaOFsv7TN9vmDYh0S3onl/W7KL5sIu0B6Fgvh5EqQKb0EXB 50WzmGfmbor9vD6iqH3tbeO3FxxRM1Np5oH2kTh+B/Bf75kZ3aAabxHZDl/jsEeyX3nT 8rqA== X-Gm-Message-State: AOAM5312nw4iM+kyS9yb2m/t9fKto4WhkkXMJtxepSQBX0fZqwJBZP4e Kcvkz57djgYZNTLPiIFaJPhIKgKWqWFMyjvIBLFmtAvb X-Google-Smtp-Source: ABdhPJwlzPCJoTRfb0qKRdgQghlnf41YF4sg1IE6+sbhOQzHMSDxR41bfmBtp9RyPmSBMvXIoSym2Co4xIGBDnLNzbA= X-Received: by 2002:a17:903:18d:b0:142:12ba:8513 with SMTP id z13-20020a170903018d00b0014212ba8513mr26531106plg.69.1638581521072; Fri, 03 Dec 2021 17:32:01 -0800 (PST) In-Reply-To: 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:221420 Archived-At: On Fri, Dec 3, 2021 at 2:04 PM Stefan Monnier wrote: > > > 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). Copy that, thanks for the explanation. I'm not presently affected by this (no smartparens and no elixir) so I'd be happy to close this given that it's working as expected and there are clear ways to avoid it in many cases. Thanks, Aaron