From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Thu, 04 Aug 2022 01:26:04 +0000 Message-ID: <3d639ea12689d767ba2a@heytings.org> 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> <05388e8d8836c2e7ef3e@heytings.org> <136c4fe0fcb9ce5181cb@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="qT67tYGt4w" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29007"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, 56682@debbugs.gnu.org, Eli Zaretskii , monnier@iro.umontreal.ca To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 04 03:27:30 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 1oJPe5-0007Ps-RG for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 Aug 2022 03:27:29 +0200 Original-Received: from localhost ([::1]:59484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJPe4-0006f5-Jr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 Aug 2022 21:27:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJPdf-0006ep-Em for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 21:27:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oJPde-0005wO-Ja for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 21:27:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oJPde-0006WS-EY for bug-gnu-emacs@gnu.org; Wed, 03 Aug 2022 21:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Aug 2022 01:27: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.165957637125011 (code B ref 56682); Thu, 04 Aug 2022 01:27:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 4 Aug 2022 01:26:11 +0000 Original-Received: from localhost ([127.0.0.1]:50555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJPcp-0006VK-GE for submit@debbugs.gnu.org; Wed, 03 Aug 2022 21:26:11 -0400 Original-Received: from heytings.org ([95.142.160.155]:37784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJPck-0006V9-Pv for 56682@debbugs.gnu.org; Wed, 03 Aug 2022 21:26:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1659576365; bh=a5+o6Lx7K0+yvb3j0RU9iTz15Evwimp/w+7Ugzm3JK8=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=YDZVptsu3pF/VtSytRgs4lfBy1OBExnG++vM64sJD+IgA5U3l2NV/xY6jo8Z7MUaG PJRodqqU9fnKs/m0WOaOXm+kV36po8hTqNrAYKOWiBSnH7hnU0ItMv6F2/72BrytG2 NvxW8nyL/JyYNAhX4IVeyu+KsfWDrL18X+GXhTWhuE+41W/lW4gldDaOWcoDbcYInd tCmpJuWmSA5xNCbOeiOkfrYdAnHL05KHVcYSRcl3ncDmi3msadTRH/h9ANr7KycEDE DiJmX2hX+UfABkHuWOEU28XLqBZri4OW0Fl6VRfubyMa91maMSd08QSGfpbY9bXnC8 8D7mf02GPS4wA== In-Reply-To: Content-ID: <3d639ea1265927cd9c26@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:238664 Archived-At: --qT67tYGt4w Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-ID: <3d639ea1269db5eb2369@heytings.org> > > Where does one obtain dictionary.json from? > From=20here, for example: https://www.heytings.org/data/dictionary.json . >> You'll see that Emacs needs about five seconds (on my laptop) to=20 >> display the end of the buffer. > > Does that come from the long lines, or solely from the size of the=20 > buffer? > You're replying to a week old email. IIRC that delay comes solely from=20 font locking. >> Now compare that with the feature branch, with which the end of the=20 >> buffer is displayed instantaneously.=C2=A0 That five seconds delay is ca= used=20 >> by fontification-functions. > > At some point we should accept that visiting a huge file might take some= =20 > time (5 seconds doesn't sound terrible, depending on the context).=20 > Because the alternative is mis-fontifications and broken display. > If you dislike mis-fontification, turn font-lock mode off. > > Here I'm attaching a version of downloadify.js we can use for comparison= =20 > (please rename the extension from .sj to .js locally; Gmail was not=20 > letting it through otherwise). It's not a huge file, just about 88K. > It's a tiny file, not in any way representative of the ones we're dealing= =20 with. But amusingly, even with that tiny file, you can see the problem at= =20 hand. Do M-: (setq long-line-threshold nil) RET, and open it in a large=20 enough window (e.g. 160 characters). Type M->, and try to move point=20 there with C-p or C-n. You'll see that Emacs is already sluggish. > > I'm also attaching a screenshot of another problem: suddenly the bottom= =20 > several screens of the buffer are mis-highlighted as if starting inside= =20 > a string. That very much look like a result of breaking syntax-ppss's=20 > visibility of the buffer. > > So the buffer scrolls quickly but looks bad. > If you dislike mis-fontification, turn font-lock mode off. It's as easy=20 as that. Mis-fontification is expected in such cases. The docstring of=20 syntax-wholeline-max also mentions that "misfontification may then occur".= =20 Why did you not protest at that time? > > Branch feature/long-lines-and-font-locking, revision cd41ce8c6c1079 from= =20 > July 25. That branch is not there anymore, so let me know if I should=20 > re-test this with some later version of your work. > That branch doesn't exist anymore, it has been merged in master. --qT67tYGt4w--