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 16:30:17 +0300 Message-ID: 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> 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="12998"; 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, Gregory Heytings , Eli Zaretskii To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 05 15:31:15 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 1oJxQ3-0003HK-Np for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 15:31:15 +0200 Original-Received: from localhost ([::1]:50692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJxQ2-0003DU-P1 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Aug 2022 09:31:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJxPq-0003Cd-JA for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 09:31:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJxPq-0003Fz-97 for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 09:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJxPp-0001pq-UC for bug-gnu-emacs@gnu.org; Fri, 05 Aug 2022 09:31:01 -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 13:31:01 +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.16597062286986 (code B ref 56682); Fri, 05 Aug 2022 13:31:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 5 Aug 2022 13:30:28 +0000 Original-Received: from localhost ([127.0.0.1]:56730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJxPI-0001ob-8g for submit@debbugs.gnu.org; Fri, 05 Aug 2022 09:30:28 -0400 Original-Received: from mail-wr1-f49.google.com ([209.85.221.49]:35428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJxPF-0001oA-Ei for 56682@debbugs.gnu.org; Fri, 05 Aug 2022 09:30:26 -0400 Original-Received: by mail-wr1-f49.google.com with SMTP id j15so3289344wrr.2 for <56682@debbugs.gnu.org>; Fri, 05 Aug 2022 06:30:25 -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=8fU027ZMggLenpl0dcOGzltdHa/Z0G/HVcGfZvQrPcU=; b=US2mcbB6gd2JXQuokZbx0jkSWna4zAFQLK8QL9uto49rdb6qdgV8EB8J/yKuhprC+o R9qKq4ZliqtGJdzmLQqjt3t4cwyQR4Sk5tT3hSi+POmkpoomctNzUNBgBmrPJ1a4gzT2 hNhmpPZVY2TejAfRoL53EvsQcEVTrjd+nveJKFZT2wRHgAnv+uaAEr87yht0DJS+bL1b gsrJUJpS+nURlG7E8EQbIAHdx8ahEc2yoG0JLXRZG/IV73mN7wsEOyXebiQmjjkrVunv kQ68lrC5cksyxckI8oi5VzmKZR2wxidaxnCIb4vprsViwAQYXyz/PNkvnujRCnbfK8jT aDGA== 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=8fU027ZMggLenpl0dcOGzltdHa/Z0G/HVcGfZvQrPcU=; b=G4G2xTfhiIg0dMfOAtIvhBqKH/xXVczvDunWSmjJp0ogPAQsO+UCWi7UGXblGhpiRW cvoLXVHAA6z+ND7lim2TGJcQ5eoXXtUf/ptolIHrwUch9wcnsXACYuAumuTmo0jHFhfV k4NYiM9Qd0JPUE9eovGito8YKsYXGuPivOHOhJLDlcqfydeQeps19HLn4mUQ9QVF3hxa voahRd8I1YmDouCedN8QltXIpkrP1OJgFoRFU/EB8ocZ7C1OBEaxLGgDZZwGTdQivQlM RrcnQoykbAUvsrADEYs35wAe6vgzVwA5GB+n6nUXE8PlwW55SSD0MW1IdnavSt8hE25+ yKiQ== X-Gm-Message-State: ACgBeo1MsgpdLJDky9wOhriteNWt2n+h1LdFXrvM6wtesMCBe3CeKtpE u5Ab+GAG2UZ8kZLlkHNOByQ= X-Google-Smtp-Source: AA6agR6X3/mWsGvrCyHdYvQBK6bc6p44scbtZuO13FH22ZVjrgJopjykFohDEPFqFghmVGRmIImEig== X-Received: by 2002:adf:e6ce:0:b0:220:5e20:ce80 with SMTP id y14-20020adfe6ce000000b002205e20ce80mr4400042wrm.13.1659706219348; Fri, 05 Aug 2022 06:30:19 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i17-20020a05600c355100b003a2e92edeccsm9344588wmq.46.2022.08.05.06.30.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Aug 2022 06:30:19 -0700 (PDT) Content-Language: en-US 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:238913 Archived-At: On 05.08.2022 16:17, Stefan Monnier 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. 10000 seems too low, but if the 2 seconds in the dictionary.json example feels too much to people (and the file is 18 MB), maybe restrict syntax highlighting to the first 1 MB of each file? At least until someone optimizes parse-partial-sexp to work much faster. Or 10MB. Not too important as long as the value is separately customizable. Anyway, I think I'd prefer no highlighting at the end of those large files, rather than arbitrarily incorrect one.