From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Sat, 13 Aug 2022 19:59:27 +0300 Message-ID: References: <640c2e07-98e1-96d6-bb02-19f5f03f637f@yandex.ru> <834jyq29o1.fsf@gnu.org> <92da07bd028e3ede61a6@heytings.org> <47894c57-dd8b-5778-240a-3fa6540e4d37@yandex.ru> <92da07bd02941d5537e9@heytings.org> <5308e3b5-a160-17d7-77ee-b1d00acfa20d@yandex.ru> <92da07bd02a6cc861e1a@heytings.org> <837d3lzv8n.fsf@gnu.org> <2c8d6755-cfe2-6559-3fde-3fa30ffb411e@yandex.ru> <83mtcgy44k.fsf@gnu.org> <83k07jx5jn.fsf@gnu.org> <866e510d-a060-7daa-d002-97861d056fa7@yandex.ru> <1144021660321893@iva5-64778ce1ba26.qloud-c.yandex.net> <66bbbb9598b42aea3b87@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33490"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: 56682@debbugs.gnu.org, Eli Zaretskii To: Gregory Heytings , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 13 19:00:30 2022 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 1oMuUw-0008Zu-2W for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Aug 2022 19:00:30 +0200 Original-Received: from localhost ([::1]:55054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMuUu-0006xZ-V5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Aug 2022 13:00:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMuUV-0006xM-CQ for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 13:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMuUU-0001bV-Lr for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 13:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oMuUU-0006Rj-Ib for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2022 13:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Aug 2022 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.166040998024722 (code B ref 56682); Sat, 13 Aug 2022 17:00:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 13 Aug 2022 16:59:40 +0000 Original-Received: from localhost ([127.0.0.1]:34990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMuU8-0006Qg-D6 for submit@debbugs.gnu.org; Sat, 13 Aug 2022 12:59:40 -0400 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:37725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oMuU3-0006QP-Hz for 56682@debbugs.gnu.org; Sat, 13 Aug 2022 12:59:38 -0400 Original-Received: by mail-wr1-f45.google.com with SMTP id b4so1159308wrn.4 for <56682@debbugs.gnu.org>; Sat, 13 Aug 2022 09:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc; bh=4fMh2kXiZGKzIhKqrxuQgnJWrgr/bT+VQw8x+GMAiUA=; b=UxsWPJ2dSpUs3YRXaoiyrNaoyUgNw5meF9g1uxAZM0x3Vg0QB8n1WhfwxXdEL1tUo3 7SE/Ng/Igk8LGlxzGCIC0XNhZLYnInYyXZRQTiETn25oTWLIVbYreRpOoqHZJSX2snx2 WDCnxjayjQiLgryRwRZLGS0iicfyAX1aUQbb/jGn6i+PkNB+1UJWBjgbR53lEIgfSP3+ /e+L8jkI+P6cw3SjTMAxnoJ/ZVukUPuPOBzggvlckhpmlUUI6GMgg5CG2g5bG6OClyrc RqaflSM2RkXJprKo4YEuU4Hr4e3QFrTUxyp+9cDhbt3NTkYO+IxKsH9/vK2j7+O8Y5Af 4ChA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc; bh=4fMh2kXiZGKzIhKqrxuQgnJWrgr/bT+VQw8x+GMAiUA=; b=hPZhUMRGmHMG+tnK4lAVPg5B1TV3M0tFqMlEsv5stAJqK/Uc4g/0nhT9iN/LNa2KYm X5Ku1EospYQEThKC7Hr6pqKWI1wosEDU3HFpIadvp6ospLChocSuSmXAKHxDP+cb9RV3 yYeVSVjCGUIvLPxIVvzilcFqDV8I7JKxrqR8b9IZoI1ua/vULoOsEI5k4/cRGo7LewAu xwLom1jU+xAVet7dpkGLtevlQdR8zmuyf1IkcxzqiLQskm4L4hx5DC6bV7y0WwW9P2go P9SHXzOMNoW++L8NbgpNhBSqj9GUjyEPvj8VfdSoRzWQ9GcQR4RuDp+hZmN7ImRtUBVa A43g== X-Gm-Message-State: ACgBeo397g5cCZal4uFfJxANzzlAPMhxWXGHmJj+ZiuyfHaLV6SVPWJK vNEikbXaLOIOvjTCYVwyPsY= X-Google-Smtp-Source: AA6agR6qRbJ4ZbtkbDZR0De8bcitjDrjIszn3q/NqhfLO9Blt8f6lnwlqomMGcwwfYjEW0IsMO7ybg== X-Received: by 2002:a05:6000:120a:b0:21f:dfb:ff12 with SMTP id e10-20020a056000120a00b0021f0dfbff12mr4617815wrx.215.1660409969581; Sat, 13 Aug 2022 09:59:29 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id az14-20020a05600c600e00b003a3211112f8sm3460238wmb.46.2022.08.13.09.59.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 13 Aug 2022 09:59:28 -0700 (PDT) Content-Language: en-US In-Reply-To: <66bbbb9598b42aea3b87@heytings.org> 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:239568 Archived-At: On 13.08.2022 16:42, Gregory Heytings wrote: > >> >> I think we'll want to decouple the two because they aren't quite the >> same (e.g. in many cases the time taken by `syntax-ppss` doesn't >> depend on the length of lines, whereas the time taken by >> `font-lock-keywords` rues does not depend on the total buffer size). >> > > That's what I initially thought, too.  Now I tend to think that it would > be better to not decouple these two cases, because it would be too > expensive to distinguish the four possible cases, namely: I'm fairly sure that my branch demonstrates that there's nothing expensive about it. It's just one commit, 20 additions, 10 deletions. It should take 2 minutes max to read and understand it. Yes, it adds a new custom var (for readability's sake we could split it in two later). But that's only logical since it handles an orthogonal problem to the one that long-line-threshold is about.