all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Chong Yidong <cyd@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Setting bidi-paragraph-direction in comint modes
Date: Tue, 14 Feb 2012 19:55:07 +0200	[thread overview]
Message-ID: <83d39hxptw.fsf@gnu.org> (raw)
In-Reply-To: <87vcn9zzuf.fsf@gnu.org>

> From: Chong Yidong <cyd@gnu.org>
> Date: Tue, 14 Feb 2012 14:35:52 +0800
> 
> 1. emacs -Q
> 2. M-x shell RET
> 3. ls /usr/share/doc    (Prints about 2000 lines on my computer)
> 4. Repeat step 3 many times.
> 
> As the buffer gets to about 8000 lines, redisplay slows to a crawl.

I cannot reproduce this here.  I tried the same in a directory with
2190 files, generated a 10K-line buffer with no empty lines, and I see
no "crawl", only some minor slowdown.  Maybe I didn't try the commands
you did?  Which Emacs commands caused such a slow redisplay on your
machine?

In any case, see this comment in bidi.c:

  /* On my 2005-vintage machine, searching back for paragraph start
     takes ~1 us per line.  And bidi_paragraph_init is called 4 times
     when user types C-p.  The number below limits each call to
     bidi_paragraph_init to about 10 ms.  */
  #define MAX_PARAGRAPH_SEARCH 7500

In my experience, 4 x 10 = 40 ms is not perceived as a terrible
slowdown, and most machines people use today are faster than mine.
This number was tuned to treat reasonably well hard cases such as the
one described in bug #9470.

> AFAICT, bidi paragraphs don't make sense in Comint-like modes
> anyway.

Unfortunately, it does: a console program that displays localized
messages through gettext will need dynamic determination of the
paragraph direction in bidirectional locales, to display the messages
as users of those locales expect.

In any case, I'd like first to reproduce the problem, and then look
into its root cause.  Somehow, I doubt that searching for the
paragraph start is it, with the above limit in effect.



  parent reply	other threads:[~2012-02-14 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-14  6:35 Setting bidi-paragraph-direction in comint modes Chong Yidong
2012-02-14 17:52 ` Stefan Monnier
2012-02-14 17:55 ` Eli Zaretskii [this message]
2012-02-15  0:49   ` Chong Yidong
2012-02-15  4:01     ` Eli Zaretskii
2012-02-15  6:24       ` Chong Yidong
2012-02-15 17:01         ` Eli Zaretskii
2012-02-17  5:44           ` Chong Yidong
2012-02-15 17:46         ` Johan Bockgård
2012-02-15 18:33           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d39hxptw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=cyd@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.