From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#56682: Fix the long lines font locking related slowdowns Date: Sat, 23 Jul 2022 16:33:28 +0200 Message-ID: References: <837d46mjen.fsf@gnu.org> <174616cd5c33bfc14b1f@heytings.org> <837d44jr4p.fsf@gnu.org> <83bktghrn0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23346"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: 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 Sat Jul 23 16:34:11 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 1oFGCo-0005rX-Jt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 16:34:10 +0200 Original-Received: from localhost ([::1]:54776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFGCn-0007wm-5l for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 23 Jul 2022 10:34:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFGCg-0007wd-QY for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 10:34:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFGCg-0003e6-H9 for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 10:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oFGCg-0006HA-CR for bug-gnu-emacs@gnu.org; Sat, 23 Jul 2022 10:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 23 Jul 2022 14:34: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.165858681724086 (code B ref 56682); Sat, 23 Jul 2022 14:34:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 23 Jul 2022 14:33:37 +0000 Original-Received: from localhost ([127.0.0.1]:45990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFGCH-0006GQ-19 for submit@debbugs.gnu.org; Sat, 23 Jul 2022 10:33:37 -0400 Original-Received: from mail-ej1-f42.google.com ([209.85.218.42]:37630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFGCF-0006GD-Qf for 56682@debbugs.gnu.org; Sat, 23 Jul 2022 10:33:36 -0400 Original-Received: by mail-ej1-f42.google.com with SMTP id os14so13132426ejb.4 for <56682@debbugs.gnu.org>; Sat, 23 Jul 2022 07:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :user-agent:mime-version:content-transfer-encoding; bh=wLZYfpqrIJbk3qOQmsniNNgQ52TvlZ936qorl+KpTOE=; b=bmkURPu9k6diXuXCqAtlR60wDl/cPJzcVuLFglII8FN2huxgWCjfu2bmEfTdN/KSUQ m69ymf0twGeaqEIPnKLtSPutxKZ72f+/EYFlBcE/e492xJssahNphhARJmUmrhS/uOUK bazQZHYLSMFxGWvNZjlBnjmzSLEpcJuXWHH16tVJf+3V6tJ2nRcZz8ZY7t/AHUuJgPEe v3E4Tld99Qo8oNaDWEq4Dq3baA06IpH+mbSLbIvrxMJNJzM51QohQtdI2sexED0z6+6R yBtmqZChRkOJP9wKYs9katctVYq4QupbU0/pHr9OG/a2QeMMZvar63kzya0I1E0kiHVG kBlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:user-agent:mime-version:content-transfer-encoding; bh=wLZYfpqrIJbk3qOQmsniNNgQ52TvlZ936qorl+KpTOE=; b=193nMlMgMyozQrZo9ocoTIDN/AYroUYpVeVUJNEcK70FPNPCoeeHngwP2V2+d69Gts ojLII2RWhNyKjJhdnW8ZJaI5XqxTrZvAnLTTTuXmhCTwe2cEIVGtP8hP+GSNkk+aJObu eU1bhMgMUc2WsoDjQccNfod0CfA9Pslg+iI1p8ZP92Wcl0qZ5oYoIMZks3IYoQC0ET+K e0pIyH59p4VBqpV2hWv7p7zYidAy2qxis706d5mGkVyEueabUkHLibOIhD2+K8YQMR3k ta7d+jVnX1XqUR75B7+b9iGtZwQXV4e96p4R0JSiXosPyY1pnju4N5g8LqITmINFR1gj CtHQ== X-Gm-Message-State: AJIora/u5JWLnpE2E62IGD+evUYSCqltjhv93Uiwo6xW+ztH5/9vcALa UQJarbuloj1XYJNcgzR2UOY= X-Google-Smtp-Source: AGRyM1vYdFKgaTi+AjNklSVR09nu/K6Yb06C8Qr4V7UUi5rtIhgMIdlL1g3VohylFg2kXFKV93Km0w== X-Received: by 2002:a17:907:a40b:b0:72b:64e3:4c5e with SMTP id sg11-20020a170907a40b00b0072b64e34c5emr3743311ejc.612.1658586809849; Sat, 23 Jul 2022 07:33:29 -0700 (PDT) Original-Received: from Mini.fritz.box (p54b0c574.dip0.t-ipconnect.de. [84.176.197.116]) by smtp.gmail.com with ESMTPSA id g6-20020a17090669c600b0072a815f569bsm3189266ejs.185.2022.07.23.07.33.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jul 2022 07:33:29 -0700 (PDT) In-Reply-To: ("Gerd =?UTF-8?Q?M=C3=B6llmann?="'s message of "Sat, 23 Jul 2022 16:25:34 +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:237748 Archived-At: Gerd M=C3=B6llmann writes: > Eli Zaretskii writes: > >> And I've found a serious sink of CPU cycles under truncate-lines, and >> installed a fix on the feature branch. Gerd, if you have time to >> eyeball the fix and comment on it, I'd appreciate. It's commit >> 350e97d on the branch. (I can post a more detailed explanation of >> what I did and why, if that would help, because the code and the >> functions it calls are somewhat tricky.) > > I'll look at it and come back. modified src/xdisp.c @@ -7153,10 +7153,10 @@ forward_to_next_line_start (struct it *it, bool *sk= ipped_p, || ((pos =3D Fnext_single_property_change (make_fixnum (start), Qdisplay, Qnil, make_fixnum (limit)), - NILP (pos)) + (NILP (pos) || XFIXNAT (pos) =3D=3D limit)) && next_overlay_change (start) =3D=3D ZV)) { - if (!it->bidi_p) + if (!it->bidi_p || !bidi_it_prev) { IT_CHARPOS (*it) =3D limit; IT_BYTEPOS (*it) =3D bytepos; I understand the first diff, which makes a lot of sense, but I'm afraid I don't know enough about bidi to be of any help.