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#48734: 28.0.50; Performance regression in `string-width`? Date: Sun, 30 May 2021 15:05:52 +0300 Message-ID: <835yz04ean.fsf@gnu.org> References: <87a6odmfp6.fsf@teknik.io> <83o8cs4t9m.fsf@gnu.org> <87y2bwk1nj.fsf@teknik.io> <83eedo4k3j.fsf@gnu.org> <87v970jwik.fsf@teknik.io> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3736"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48734@debbugs.gnu.org To: Imran Khan Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 30 14:06:11 2021 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 1lnKCp-0000lN-GY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 14:06:11 +0200 Original-Received: from localhost ([::1]:35146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnKCn-000191-Uj for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 May 2021 08:06:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnKCg-00018e-IO for bug-gnu-emacs@gnu.org; Sun, 30 May 2021 08:06:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lnKCg-0004oX-BE for bug-gnu-emacs@gnu.org; Sun, 30 May 2021 08:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lnKCg-00020V-5s for bug-gnu-emacs@gnu.org; Sun, 30 May 2021 08:06: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: Sun, 30 May 2021 12:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48734 X-GNU-PR-Package: emacs Original-Received: via spool by 48734-submit@debbugs.gnu.org id=B48734.16223763527695 (code B ref 48734); Sun, 30 May 2021 12:06:02 +0000 Original-Received: (at 48734) by debbugs.gnu.org; 30 May 2021 12:05:52 +0000 Original-Received: from localhost ([127.0.0.1]:58487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnKCW-000203-0Z for submit@debbugs.gnu.org; Sun, 30 May 2021 08:05:52 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lnKCS-0001zm-Uy for 48734@debbugs.gnu.org; Sun, 30 May 2021 08:05:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38052) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnKCN-0004d1-Mz; Sun, 30 May 2021 08:05:43 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:3320 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 1lnKCN-0006xv-92; Sun, 30 May 2021 08:05:43 -0400 In-Reply-To: <87v970jwik.fsf@teknik.io> (message from Imran Khan on Sun, 30 May 2021 17:23:15 +0600) 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:207609 Archived-At: > From: Imran Khan > Cc: 48734@debbugs.gnu.org > Date: Sun, 30 May 2021 17:23:15 +0600 > > Basically deft-mode takes a folder full of normal org-mode files, and > constructs a pretty "dashboard" view of the folder where you can browse, > search, filter the files in said folder (and many other features). > > The dashboard UI uses `string-width` to calculate how much space is to > be allocated relative to window width to display metadata like file > title, file content summary, mtime etc for each file per line. This is > dynamic, the components size adjusts to window width change. Perhaps the > screenshot they have in their project page would be more descriptive: > > https://github.com/jrblevin/deft > > Org-mode files typically have unicode chars in them. So when deft-mode > uses `string-width` to construct view of file content part, it > hangs. I think the performance problem here is exacerbated because > deft-mode is stripping all vertical whitespace to squash the content to > show in a single line summary view, before calling `string-width`. If deft-mode wants to allocate space on display, then they really do need to use string-width, but then the changes which make them "hang" are really important, because before that string-width would compute the result incorrectly when characters are composed on display.