From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.devel Subject: Performance under bidi-paragraph-direction 'left-to-right vs bidi-display-reordering nil Date: Sun, 24 Nov 2019 23:41:56 +1300 Message-ID: <06329813-a32a-2eb8-61b9-337b67d84a4c@orcon.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="51895"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 To: "emacs-devel@gnu.org" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 24 11:42:39 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 1iYpLf-000DKc-LF for ged-emacs-devel@m.gmane.org; Sun, 24 Nov 2019 11:42:35 +0100 Original-Received: from localhost ([::1]:34708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYpLe-00060r-HF for ged-emacs-devel@m.gmane.org; Sun, 24 Nov 2019 05:42:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56008) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iYpLA-0005y8-OS for emacs-devel@gnu.org; Sun, 24 Nov 2019 05:42:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iYpL9-0006BY-Bv for emacs-devel@gnu.org; Sun, 24 Nov 2019 05:42:04 -0500 Original-Received: from smtp-4.orcon.net.nz ([60.234.4.59]:44829) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iYpL9-0006A1-1D for emacs-devel@gnu.org; Sun, 24 Nov 2019 05:42:03 -0500 Original-Received: from [116.251.203.175] (port=21767 helo=[192.168.20.103]) by smtp-4.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1iYpL3-0005L1-1E for emacs-devel@gnu.org; Sun, 24 Nov 2019 23:41:57 +1300 Content-Language: en-GB X-GeoIP: NZ X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 60.234.4.59 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:242681 Archived-At: 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. (Which doesn't seem entirely unexpected when stated like that. I think I'd simply been under a misapprehension that the change we'd made would have more similar performance characteristics than is actually the case. I failed to notice anything at the time, because I'd forgotten that I'd (setq-default bidi-display-reordering nil) in my own config after bug 23801 -- believing back then that this was a supported setting.) As before, the JSON file from https://emacs.stackexchange.com/q/598 serves as an example: wget https://github.com/Wilfred/ReVo-utilities/blob/a4bdc40dd2656c496defc461fc19c403c8306d9f/revo-export/dictionary.json?raw=true -O one_line.json With global-so-long-mode enabled visiting one_line.json does not hang Emacs; but for me there is a very noticeable 'lag' to interactive movements around the early parts of that buffer which disappears completely if I set bidi-display-reordering to nil. 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. 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. -Phil