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: Sun, 14 Aug 2022 20:54:52 +0300 Message-ID: <5c22e38a-5dcd-860e-28a0-b4a5ede6a21b@yandex.ru> References: <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> <12348081660379417@sas2-a098efd00d24.qloud-c.yandex.net> <66bbbb95983414e79637@heytings.org> <83wnbckp0q.fsf@gnu.org> <8e884ebe-2d2e-d599-15c3-a5cfe5e6b295@yandex.ru> <83o7wnl7ok.fsf@gnu.org> <036414cc-c711-efaf-ed5b-f8ccfaca0604@yandex.ru> <5900f20836753183a6ac@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19532"; 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 , monnier@iro.umontreal.ca To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 14 19:56:24 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 1oNHqa-0004tK-Al for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 19:56:24 +0200 Original-Received: from localhost ([::1]:37940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNHqZ-0000MN-Ay for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Aug 2022 13:56:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44132) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNHqF-0000M5-5d for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 13:56:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50112) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNHqE-0007T8-G3 for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 13:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNHqE-0007v4-AO for bug-gnu-emacs@gnu.org; Sun, 14 Aug 2022 13:56: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: Sun, 14 Aug 2022 17:56: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.166049970230355 (code B ref 56682); Sun, 14 Aug 2022 17:56:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 14 Aug 2022 17:55:02 +0000 Original-Received: from localhost ([127.0.0.1]:39858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNHpF-0007tQ-RT for submit@debbugs.gnu.org; Sun, 14 Aug 2022 13:55:02 -0400 Original-Received: from mail-wr1-f53.google.com ([209.85.221.53]:38537) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNHpE-0007t1-Ix for 56682@debbugs.gnu.org; Sun, 14 Aug 2022 13:55:00 -0400 Original-Received: by mail-wr1-f53.google.com with SMTP id bv3so6730087wrb.5 for <56682@debbugs.gnu.org>; Sun, 14 Aug 2022 10:55:00 -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=GsUUhUsiVBkFZED5BkKlQoBzZgvocl85HMfte0rQWeg=; b=PL4VZ7ueQkOd4a3xzZTj2K99Kq1HWPOFR5Md6cnMo7sFkrCMmqIOFr6nmku4wWBUdA SRA6M4dgj+vAM7E5U/jqYJQ9A4lDBc7qXi6Q+HZTjGd1PhANPtZXq6oourrWH5/NbsjM 5RwTZCFpPHuq83Mw1+VBAgPjb1/FsrKgkC0JZjMOJpLVXv8Xs8V2/+G3HxbM/V9LoIxW AOsxMeJKG5Y82bexFeMgi8wB5WYRZtc2MHLHmc82onfpRBV894orO3jImLAdYdlCZ8wy NLi4NFwmRytBR05n2g8dzKG0lUs2eLSP4wM89G5Ma7RaXb0wKotY2moQD0PGrLDAT4cg CIPQ== 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=GsUUhUsiVBkFZED5BkKlQoBzZgvocl85HMfte0rQWeg=; b=lpE947ruuVBtV4piRRdE9eA9OQwp2TLmTZA8nOriJQMMJXMgbYkgOLn1FkuVs2JJpv /PcNZOCZ67sTzThxQYaYmrL6/PADP2jnKHfmEojp/DiO4TF8djX2NeBy3s7/3vPmIE44 WNc/RzDxhec5+xR3rARW1Oly0O5xxzbEQpVyDL9GCLvKXpAlukKD76FK+Jy1cNjoEh6v hNpgr+KzkrWLogfNZ4jJNxkwZz2OX7zilbzGZ3SFb6zpn5lK+RQHc/UwpD02/Xi2LwXn MTplQJK2HMGa9XBMHt+G4SA8vdQLvfqdxJMj1a7B4FVeEovkOj61yl329rYbFhNR4+EO iS7g== X-Gm-Message-State: ACgBeo1et+NkRB5/fz2k5dcpc+4YKVF3jTcSHPz6IkwmaoI+Yw84dTFq iTmCmeg15ZhltYnxxNVg1Fs= X-Google-Smtp-Source: AA6agR5hD/L4Lz33DGaOc7fp+JnK9TDsWTKynVWTfAYvDO+K6mRK8HZ9QEaOdHhC3TQTsjIwpgn2Hg== X-Received: by 2002:adf:eac5:0:b0:222:411:a94e with SMTP id o5-20020adfeac5000000b002220411a94emr6573703wrn.607.1660499694783; Sun, 14 Aug 2022 10:54:54 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j11-20020adfe50b000000b00224f67bfc95sm3937006wrm.62.2022.08.14.10.54.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Aug 2022 10:54:54 -0700 (PDT) Content-Language: en-US In-Reply-To: <5900f20836753183a6ac@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:239684 Archived-At: On 14.08.2022 19:16, Gregory Heytings wrote: > >> >> The alternative, of course, is to pay the price of syntax-ppss on >> larger spans and wait the corresponding amount of time the first time >> the user scrolls to EOB. >> > > Or to speed up syntax-ppss in a way or another. I suggest you try tweaking parse-partial-sexp's implementation. >> But as Gregory shows, when you get to _really_ large files (like 1 GB >> JSON file in his example), pressing M-> will still make you wait (I >> have to wait around 20 seconds). >> > > Or when you have a slower CPU, with moderately large files. I doubt there are any CPUs in wide use that are even 5x slower than mine. And even 200 MB is pretty large, and not something we've been reasonable able to edit before. >> But being able to choose this approach (in the absence of better >> upcoming alternatives) is a good thing. >> > > The problem is (again) that what you would like does not provide any > protection against modes which use widen inside their fontification > routines. Do you have examples of such modes? Calling 'widen' inside font-lock-keywords is a bug, and the bugs should be fixed at the source.