From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Performance under bidi-paragraph-direction 'left-to-right vs bidi-display-reordering nil Date: Sun, 24 Nov 2019 18:00:14 +0200 Message-ID: <831rtxtgc1.fsf@gnu.org> References: <06329813-a32a-2eb8-61b9-337b67d84a4c@orcon.net.nz> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="27017"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Phil Sainty Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 24 17:01:20 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iYuK7-0006sW-92 for ged-emacs-devel@m.gmane.org; Sun, 24 Nov 2019 17:01:19 +0100 Original-Received: from localhost ([::1]:36502 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYuK6-0002R1-5Q for ged-emacs-devel@m.gmane.org; Sun, 24 Nov 2019 11:01:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42225) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYuJ4-0002QW-6p for emacs-devel@gnu.org; Sun, 24 Nov 2019 11:00:15 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iYuJ3-0003vK-HC; Sun, 24 Nov 2019 11:00:13 -0500 Original-Received: from [176.228.60.248] (port=4947 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1iYuJ2-0003gc-NA; Sun, 24 Nov 2019 11:00:13 -0500 In-reply-to: <06329813-a32a-2eb8-61b9-337b67d84a4c@orcon.net.nz> (message from Phil Sainty on Sun, 24 Nov 2019 23:41:56 +1300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242684 Archived-At: > From: Phil Sainty > Date: Sun, 24 Nov 2019 23:41:56 +1300 > > As discussed in > https://lists.gnu.org/archive/html/emacs-devel/2019-07/msg00294.html > setting bidi-display-reordering nil isn't a supported/tested scenario, > and in so-long.el we changed that to set bidi-paragraph-direction to > 'left-to-right instead. > > I've just traced what seemed like a performance regression to this > change -- it's now apparent to me that there's a noticeable effect on > the redisplay performance having bidi-display-reordering enabled and > bidi-paragraph-direction set (at least under long-line situations) > which isn't experienced when bidi-display-reordering is disabled. I never said that setting bidi-paragraph-direction will provide the same CPU savings as bidi-display-reordering. If something I said could have been interpreted that way, I apologize. The latter disables the bidi reordering engine; the former does not, it just makes its job a little easier. > I do imagine that the code already tries hard to be efficient, but if > there's any chance that with only bidi-paragraph-direction set we can > achieve performance nearer to that with bidi-display-reordering > disabled, that would seemingly be beneficial for files with extremely > long lines. Maybe there's a chance, but I don't know how to optimize the code more than it already is. Ideas and patches are more than welcome in that area. > Failing that, it makes me wonder whether a nil bidi-display-reordering > should be under consideration as a supported state for end users, for > the performance benefits. Sorry, no. I will object to any core package setting bidi-display-reordering to a nil value, as that causes the display code to work in conditions it isn't supposed to, isn't being tested in, and execute branches of code that aren't being actively developed. Moreover, some parts of the display engine were written under the basic assumption that this variable is never nil. Setting that variable to nil thus gives you an Emacs that cannot be trusted to produce reliable results on display, so its only valid use is for special tests and debugging.