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: Mon, 1 Aug 2022 13:46:41 +0300 Message-ID: <96f28fd8-6744-1925-0631-0095099362dd@yandex.ru> References: <837d46mjen.fsf@gnu.org> <8a3eaeef01be5bfaa5ef@heytings.org> <05388e8d8812bfa3695d@heytings.org> <83v8rf5894.fsf@gnu.org> <65cb7c73fd4a999cca00@heytings.org> <8c7321f2f3400a5db9be@heytings.org> <8c7321f2f388e5343475@heytings.org> <6ea376f6-d503-06d8-6d83-50c52b695394@yandex.ru> <8c7321f2f3ac52bfee4b@heytings.org> <8c7321f2f3ec1ef81af9@heytings.org> <02e83b0e-1b5c-fe75-6e59-1f8ddff82d37@yandex.ru> 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="26960"; 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 Mon Aug 01 12:47:29 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 1oISxN-0006ma-4v for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 12:47:29 +0200 Original-Received: from localhost ([::1]:59604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oISxL-0004MW-QF for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 06:47:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oISww-0004Ku-1K for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 06:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49664) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oISwv-0006k6-Ol for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 06:47:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oISwv-0005BS-Kn for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 06:47: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: Mon, 01 Aug 2022 10:47: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.165935081319912 (code B ref 56682); Mon, 01 Aug 2022 10:47:01 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 1 Aug 2022 10:46:53 +0000 Original-Received: from localhost ([127.0.0.1]:39413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oISwn-0005B5-Dq for submit@debbugs.gnu.org; Mon, 01 Aug 2022 06:46:53 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:34646) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oISwk-0005Aq-7b for 56682@debbugs.gnu.org; Mon, 01 Aug 2022 06:46:52 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id j1so5235300wrw.1 for <56682@debbugs.gnu.org>; Mon, 01 Aug 2022 03:46:50 -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=ku5HpnpEQDfg9ekxmvsXxqmmVu7Avpm3+hGHtJCspEY=; b=X9eNqEWaOyXWy8ofcN/6EbFfS0kdnNSvEO4ZnUmC37XjrY1i+AnAhx3nyr0luNarK9 ixW8W2ZghYEGgMFqV0zgp8H9gShKxUV4sqeRVwKNl6R8uNSGeCjndHdy6lvekdGMxw0M w8CcCC6JfmM+0uy4RvOLLViAMx4OYzjV7al/WghLZmTs3FhympaoLXSR9Y32rULL8eUZ WrGPMsPjvscLaSDj01huFOJGarsWgu21ghYq+b1Q3XPI2FtAENNXUHUghQUoQ/2tQDbF OtSzfL3QuT7cHGFR0spXaprUodXTTILTougzFMofdUf1SY7XEMb+jc+7fNHzyaPqczQn AkFg== 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=ku5HpnpEQDfg9ekxmvsXxqmmVu7Avpm3+hGHtJCspEY=; b=NF2RNkPvlQCB4QwYrXhns//MfIo+e0eqckxjG4v5CngDTD2ITFSZAV9ieju72sSKuz Q7gDZgvKpCRXB2Nm1PDXEm9OZigACxZ8jHr+G74SOIR4KsFqtP/lPkR1t16OGIbeoIe5 KKOHQ7GxPFbVP2V/JRackB5AyFWd94PWQ3V3cMOtaStz+OP8KAEm3wrRIzA41btOoOc/ r3uFKuw1saSzDPCCkDemUzgqFOSTPH4z2OCmh9AWzXAHijHIk9oFPISyJd8ysOZK8RJ2 E+l/SCcCi2TohftWEoAPaNXO3NT1rgYvgf9KQ+lZvmlelE1afTRapWYeuZZugD8XHRKT Fd1w== X-Gm-Message-State: ACgBeo2rNgBfEEHtXDmtLOEjFKN86DcdDSVd1JebxwtC8e5m9Fgekqls GeBX06PlPZ6xtTjbAJ+1MHM= X-Google-Smtp-Source: AA6agR6ng9LnThpFM/SESeKSF/bbD5PWy5mKLuqBDjrd7XzCnL1LU6M3Lf1nmvZOo3P4n+OW41mHlg== X-Received: by 2002:a5d:453a:0:b0:21e:cfb2:b325 with SMTP id j26-20020a5d453a000000b0021ecfb2b325mr9436248wra.540.1659350804359; Mon, 01 Aug 2022 03:46:44 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id a6-20020a5d53c6000000b0021ea5b1c781sm11466008wrw.49.2022.08.01.03.46.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 01 Aug 2022 03:46:43 -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:238402 Archived-At: On 01.08.2022 12:56, Gregory Heytings wrote: > >>> Given your and Dmitry's feedback, I just tried to add an explicit >>> call to (syntax-ppss (point-max)), without narrowing, when the buffer >>> is opened (see below). >>> >>> The problem is that this is, as I said, slow.  On my laptop, opening >>> a 1 GB file takes about 6 seconds.  The call to syntax-ppss adds 70 >>> seconds, so opening a large file becomes an order of magnitude slower >>> (13 times slower).  Which I think is too much for the added benefit. >> >> But that only has to happen when the buffer is scrolled to the bottom, >> right? >> > > No, it happens when the buffer is opened.  Given the importance that you > and Stefan seem to give to that function, it is, with the patch I sent > in my previous post, called once on the whole buffer (without any > narrowing) when the file is opened. But if the buffer is not scrolled to the end, shouldn't it be called with a position that's close to the beginning? That shouldn't force the full buffer scan, meaning this call should complete quickly.