From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Sat, 23 Jul 2022 10:12:07 +0300 Message-ID: <83sfmsi9q0.fsf@gnu.org> References: <837d46mjen.fsf@gnu.org> <174616cd5c33bfc14b1f@heytings.org> <837d44jr4p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10598"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, gregory@heytings.org, monnier@iro.umontreal.ca To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 23 09:13: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 1oF9KL-0002eT-8S for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 09:13:29 +0200 Original-Received: from localhost ([::1]:45150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oF9KK-0008TZ-4S for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 03:13:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oF9Jw-0008SG-53 for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 03:13:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oF9Ju-0007ra-Vc for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 03:13:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oF9Ju-0002dz-QZ for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 03:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2022 07:13: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.165856033710058 (code B ref 56682); Sat, 23 Jul 2022 07:13:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 23 Jul 2022 07:12:17 +0000 Original-Received: from localhost ([127.0.0.1]:43092 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oF9JB-0002cA-HP for submit@debbugs.gnu.org; Sat, 23 Jul 2022 03:12:17 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oF9J9-0002bx-G5 for 56682@debbugs.gnu.org; Sat, 23 Jul 2022 03:12:15 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34868) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oF9J4-0007nU-9I; Sat, 23 Jul 2022 03:12:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ikzWiM2Z+3Dtmn66JB648AENLrvNeuwjIMJC5cCx/rk=; b=rtwctNXj4IVoH2bvR7iQ FsT7V7Ho+BOqe7YhUg627RMFg9KYX6i1myNAyoQ8zVRlWPA4hleECm7ugg4zAo4eX0EE5R8H4SCVX oElQmLEcISCSMvUpXFnzrzkXCicLdIRT15mqcecTrRjJtG0Ut+Et4wux4HuFrSLn2Jg5jvwfGGWMT LOp0nnmyhp7RrwNFiQRJLjmLE+5brkdO3fmzT75BRc4yzxI2ivJX8/k0ehgPxxTy4uIXYqYek4geS dFiCPmgWfFkXuLW9nnLzFntXhs0Lq9V2J6qL+V8+w3tkdz9yMIUw8GvybCmyP6Cg0nSpVnmkxBdsS JejWRC6ggRkKBA==; Original-Received: from [87.69.77.57] (port=1883 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oF9J3-000681-LP; Sat, 23 Jul 2022 03:12:10 -0400 In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Sat, 23 Jul 2022 09:07:53 +0200) 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:237681 Archived-At: > From: Gerd Möllmann > Cc: Gregory Heytings , 56682@debbugs.gnu.org, Stefan > Monnier > Date: Sat, 23 Jul 2022 09:07:53 +0200 > > Eli Zaretskii writes: > > > on long-line.xml produces a 15-fold slowdown with font-lock turned on > > as compared to its being turned off (203 sec vs 13 sec). > > > > This is an unoptimized build, so you will probably see times that are > > 4 times faster, but I'd be interested in the relative times on your > > system. Any explanations of the slowdown are also welcome. > > MacOS 12.5, M1 chip > Head: 792734a6e2cd5558debc8d9fe95d34cb3e809fa4 Improve efficiency of DND > tooltip movement > ./configure --with-native-compilation > > The long-lines.xml is 313295 bytes. Hope that's the right one. > > Font-lock Output > ------------------------------------------------------------ > on GCs: 14 Elapsed time: 7.880788 seconds > off GCs: 2 Elapsed time: 0.885791 seconds Thanks. This is still an order-of-magnitude slowdown, so the question about the reasons is still relevant. One thing we do under font-lock is merging faces, but that's supposed to be very fast nowadays, given that faces are kept in a hash-table. And what jit-lock does when the text is already fontified should be negligible, right?