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: Tue, 26 Jul 2022 02:23:42 +0300 Message-ID: References: <837d46mjen.fsf@gnu.org> <8335esjppt.fsf@gnu.org> <837d43j198.fsf@gnu.org> <83y1wjhkkh.fsf@gnu.org> <83wnc3hkdg.fsf@gnu.org> <49df74e5-e16a-a532-98d1-66c6ff1eb6c6@yandex.ru> <83pmhuft5a.fsf@gnu.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="4663"; 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: gerd.moellmann@gmail.com, 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 26 01:24:14 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 1oG7Qs-0000za-3m for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 26 Jul 2022 01:24:14 +0200 Original-Received: from localhost ([::1]:41524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oG7Qq-0003z8-Pk for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Jul 2022 19:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oG7Qg-0003ym-OB for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2022 19:24:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33791) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oG7Qg-00084X-FO for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2022 19:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oG7Qg-0000lA-8u for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2022 19:24: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: Mon, 25 Jul 2022 23:24: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.16587914352901 (code B ref 56682); Mon, 25 Jul 2022 23:24:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 25 Jul 2022 23:23:55 +0000 Original-Received: from localhost ([127.0.0.1]:51773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oG7QZ-0000kj-7d for submit@debbugs.gnu.org; Mon, 25 Jul 2022 19:23:55 -0400 Original-Received: from mail-ej1-f48.google.com ([209.85.218.48]:40553) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oG7QU-0000kP-WE for 56682@debbugs.gnu.org; Mon, 25 Jul 2022 19:23:54 -0400 Original-Received: by mail-ej1-f48.google.com with SMTP id tk8so23220191ejc.7 for <56682@debbugs.gnu.org>; Mon, 25 Jul 2022 16:23: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=hC+Ai0bRvhHyvWyXKAicxcsyAZBLMCgNt1NqZf/2GOo=; b=H6OEE4REoSAoJMVOW2PiyLGr4khQAzlN5PQwCU2T3/sbrOVH2m4L+DZxTocm+3VcyV GIsgwe4cvib6t03u32LfLxydj6Wwy9GA/GfHGBfqxq37I06owNA+GocDER78kFM+uQ2D uSq6x5+FhBrGl66cea+qv/7Ke36NcgOsCllkDu/gs6u6BjPrgC1A8i79d6nWyJwR4nZY 1NGPaYgSW+E2/IDnaJw6X0ZTRsgDC73MPMh8RkUbon5huk7c8EgIBRpi8t+5uJmXfupJ 8YUGFYAQIwdfuf+KiPp0oqBUeT8MTVN4RxAC6vOWKfLNVe9gYR7X/t+e7LHRIZ12uesM ojbA== 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=hC+Ai0bRvhHyvWyXKAicxcsyAZBLMCgNt1NqZf/2GOo=; b=nTvPvCQczahlxYjJm4kfekdqGy180xqicbkqkHQXwfvLHRtT3rRgbA32pJi0qkmvix /YJJCqdH9aEfu6UA4sYjWNqfDAmUnWOcr7bFGlGtTZzOgUGO/uyZo30iY28V9w2SUijR xMeDB/epETOEfCjsZpIwU/zz0t6LP+UAn1t8KmN6sbyJtkruoujWjuGphiI5bYWe4hEB eXfCRUy/8E2XTditZ5ehNGaDp7WU7Imo5YFDtI1aqtojLG/hd9n4HlYYxTxtxIRELBYf J6rEYknIwJsBPLioRZyDcA5vooU4ZZcUWlACayjP5r5hqsCwkYZ/Z/6knuoZL1WCCgvz IgIA== X-Gm-Message-State: AJIora/3BdYmWNjXslBtzqUxKYCH/e09Vuekc93i8QjsGcRkV6c6vJJ8 otcacqOhgNeORyHG7TedLls= X-Google-Smtp-Source: AGRyM1sOrwGqeCzbv3auUVe7K1+qAvSOTgjz4BHf0lzVy071bATWBjfb90nJ/9oVOKrfKSTuk1C8YQ== X-Received: by 2002:a17:907:720a:b0:72b:549e:305a with SMTP id dr10-20020a170907720a00b0072b549e305amr11635479ejc.691.1658791424107; Mon, 25 Jul 2022 16:23:44 -0700 (PDT) Original-Received: from [192.168.236.48] ([173.237.64.48]) by smtp.googlemail.com with ESMTPSA id q14-20020a17090676ce00b007121361d54asm5866280ejn.25.2022.07.25.16.23.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Jul 2022 16:23:43 -0700 (PDT) Content-Language: en-US In-Reply-To: <83pmhuft5a.fsf@gnu.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:237912 Archived-At: On 24.07.2022 18:05, Eli Zaretskii wrote: >> Date: Sun, 24 Jul 2022 17:35:19 +0300 >> Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca >> From: Dmitry Gutov >> >> On 24.07.2022 08:50, Gerd Möllmann wrote: >>> Eli Zaretskii writes: >>> >>>>> My bet is indeed on the mere presence of text properties, plus the >>>>> fact that we need to merge faces. But I could well be wrong. >>> Can't say something about face merging, but "frequent" changes of faces >>> certainly have an effect on iterator performance. It stops, looks up >>> properties again to determine the next stop pos, does what has to be >>> done for current properties... >> >> But the problem is contingent on having long lines, isn't it? > > Not necessarily, see the times I measured scrolling through xdisp.c, > which I posted earlier. It could be that with long lines font-lock > just makes it slower still, to the point where it becomes unbearable. Why with long lines, though? >> There must be some interplay between those circumstances. Not just >> having to look up faces (relatively) a lot. > > What else did you have in mind? Some operation dependent on the length of the current line? With font-lock, it seems to get progressively slower the farther you get along the current (long line). E.g. you can have a long line spanning several screenfuls without line breaks. When the window is scrolled to the beginning, redisplay is relatively fast (I can press up/down arrows, and they seem responsive). But if I scroll the window to the end of said long line, up/down commands become much less responsive. Tested that with today's master and js-mode visiting a minified JS file. Perhaps it's due to font-lock logic in that it has to match from the beginning of a line (not sure we'd want to abandon that promise, though). Or maybe something else.