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: Fri, 5 Aug 2022 17:00:31 +0300 Message-ID: <5308e3b5-a160-17d7-77ee-b1d00acfa20d@yandex.ru> References: <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <8c7321f2f36494299e61@heytings.org> <8c7321f2f336523624e3@heytings.org> <83r1202meh.fsf@gnu.org> <6020ffaf-9069-0070-76cf-a13379ef01b5@yandex.ru> <83les71ilg.fsf@gnu.org> <06c5560d-3009-e5a5-3d33-fe5d2ec32d6b@yandex.ru> <74ddc877f17a06d8f120@heytings.org> <100d08b3-c25b-683f-6def-39052107ab59@yandex.ru> <83h72r16g1.fsf@gnu.org> <640c2e07-98e1-96d6-bb02-19f5f03f637f@yandex.ru> <834jyq29o1.fsf@gnu.org> <92da07bd028e3ede61a6@heytings.org> <47894c57-dd8b-5778-240a-3fa6540e4d37@yandex.ru> <92da07bd02941d5537e9@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="32541"; 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 , Stefan Monnier To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 05 16:07:11 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 1oJxyp-0008Lf-NS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 16:07:11 +0200 Original-Received: from localhost ([::1]:47158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJxyo-0006eZ-Hr for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 10:07:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJxss-0000a7-Q5 for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 10:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJxss-0000zp-HE for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 10:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJxss-0003UJ-7D for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 10:01: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: Fri, 05 Aug 2022 14:01: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.165970804313374 (code B ref 56682); Fri, 05 Aug 2022 14:01:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 5 Aug 2022 14:00:43 +0000 Original-Received: from localhost ([127.0.0.1]:60169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJxsZ-0003Td-0c for submit@debbugs.gnu.org; Fri, 05 Aug 2022 10:00:43 -0400 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:53918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJxsV-0003TQ-T3 for 56682@debbugs.gnu.org; Fri, 05 Aug 2022 10:00:41 -0400 Original-Received: by mail-wm1-f45.google.com with SMTP id a11so1459111wmq.3 for <56682@debbugs.gnu.org>; Fri, 05 Aug 2022 07:00:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=rwYXnhBETiBkeieCFII4gumzm6pOECliYKkTCAX56i4=; b=nVB39hBaISHU4qcaChhbkJchATXqh/yittzgMeX8hlZqjeOzXiMGDEvcPSKU7KG/qf eq3MS51QE6FxjwJlLVqsH6z+2sf5DrkA7E2b713pz4AmK51Hd4wKOQ0Ttoxvx1JFbn2x 8l1jZSKqKxRCSe0lrWlRBfgHj3JvYrBaJFWWHOMk9IwYeiV94RVIh1hZBNK8YCLjNlgJ TrwWTk+yj2Ne3hjjvj3Z3qh0i9nQbjc8/W2XPpZXtHH4b1/QIx3jxgGRBvr48lXmHj9n ItFx1YMYhmOnFLtgEfwnDlsh/AaThOB3c0FbH6VY9pfcn0wPWjo8YDpbk68qbmyqSziY q7+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=rwYXnhBETiBkeieCFII4gumzm6pOECliYKkTCAX56i4=; b=U/ITwp3UYJWYI3PKJ6+IVxRAWGqjjHlHED44LNnZG7/Kseo2+uu0FPHjQfq4tCQ0sn UFE22bUlUl0zcKfJR/xgxQE2AUBxtRlRr88ydxvruvgcCPlQNH2G8DJ0Z2v1oGh2EguJ 4WUAWj81T5DzY+e+sQAr1Yt0lZU9EDwhh9ZcAQxh5eoc2SxqhD7xZ4VnR/WBJNIu/iTj jCI1r+H84nZAErh6nQ6L3zgM2S+CXVbydko9a8WId8WKjpror8k728xWcG4asqASaYRX RD1RBCcxrO6HzDxjvuH/exlTDPaqa/gFg7zvNLha9bp79EE1FIMrDizXUXWzGuvnquVe IyGQ== X-Gm-Message-State: ACgBeo0E/4BkVNjIbnEXUQmX8/uZ8YeSF5CsMWpEjVJSASM0+R6ymJRj KyGdFxgdwQdgHzIBnNBYHCk= X-Google-Smtp-Source: AA6agR5TZmVgoUkkBV6MfSYkkDOyMjpFNFj32tqdxHgNrR8whdKugXZGbmZFU37hX7wFupTCKd6S0w== X-Received: by 2002:a05:600c:4e92:b0:3a3:2a1c:d005 with SMTP id f18-20020a05600c4e9200b003a32a1cd005mr9824774wmq.170.1659708034026; Fri, 05 Aug 2022 07:00:34 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id j42-20020a05600c1c2a00b003a30c3d0c9csm10089862wms.8.2022.08.05.07.00.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Aug 2022 07:00:33 -0700 (PDT) Content-Language: en-US In-Reply-To: <92da07bd02941d5537e9@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:238920 Archived-At: On 05.08.2022 16:41, Gregory Heytings wrote: > >>> What I'm not sure of is how useful is a "font-lock with arbitrary >>> narrowing", where portions will be highlighted as strings rather than >>> code (and vice-versa).  I don't have enough experience with it yet to >>> be sure.  Taking a step back, I suspect that the only "real" solution >>> is something like `jit-lock-defer` coupled with a way to perform the >>> font-lock (and syntax-ppss/propertize) in the background. >> >> IIRC I heard that "some other editors" take the approach of >> restricting syntax-highlighting to just the beginning of a large file. >> > > Other editors just give up syntax highlighting altogether even with the > 18 MB file (and you cannot edit really large files with them). In my testing, with my patch, the 18 MB file works reasonably well and has good syntax highlighting. > But if you're so annoyed by mis-fontification, why don't you just turn > font-lock mode off? "If you're annoyed by Emacs's performance with large files, why don't you just never open them?" I like font-lock and the visual cues that come with it. Only font-locking the first 1 MB of a large file seems like a good compromise: show correct highlighting where we can with reasonable performance, and omit it in the rest of the file. > Also, why did you not protest vehemently when Stefan added > syntax-wholeline-max, which also causes occasional mis-fontification? I have replied to this exact question in an earlier email. We can continue this line of inquiry in that subthread.