unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Antipov <dmantipov@yandex.ru>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Region cache for bidi paragraphs?
Date: Mon, 05 Aug 2013 18:18:09 +0300	[thread overview]
Message-ID: <83siyow4i6.fsf@gnu.org> (raw)
In-Reply-To: <51FF378D.9000305@yandex.ru>

> Date: Mon, 05 Aug 2013 09:26:37 +0400
> From: Dmitry Antipov <dmantipov@yandex.ru>
> CC: emacs-devel@gnu.org
> 
> Input 0: xdisp.c
> Input 1: ASCII text 30K lines, 1000chr/line, no paragraph separators
> Input 2: ASCII text 30K lines, 1000chr/line, paragraph separator after each line
> 
> Time is in seconds as reported, smaller is better.
> 
> Input  0        1        0 cached 1 cached
> -------+--------+--------+--------+-------
> 0      30.2     12.7     30.4     12.7
> 1      11.1     34.5     6.4      15.3
> 2      6.0      13.1     5.2      13.1
> ------------------------------------------
> 
> I.e. longer lines and smaller amount of paragraph separators =>
> more benefits from using region cache.

Thanks for the data.

The gains sound marginal to me, especially given that the use case
where the gains are tangible (Input 1, very long line and no paragraph
separators anywhere in sight) doesn't look like a frequent use case.
Even in that case you get a speedup of a few milliseconds per
redisplay cycle.

I'm not sure this is worth the extra complexity, but if Stefan thinks
otherwise, I won't object.

There's one problem with your suggestion that perhaps needs to be
fixed before this is installed: you invalidate the cache on each
modification of the buffer, so scrolling through a buffer in a mode
that has font-lock set up will constantly invalidate the cache, since
adding text properties constitutes a "modification" of the buffer
text.  When I scroll through xdisp.c, I see the breakpoint set where
you invalidate the cache in insdel.c being constantly hit whenever
Emacs scrolls some new text into view.

Since most modes have font lock nowadays, I think leaving this
unhandled will all but eliminate the gains in most use cases.



  reply	other threads:[~2013-08-05 15:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-02 11:11 Region cache for bidi paragraphs? Dmitry Antipov
2013-08-02 14:03 ` Eli Zaretskii
2013-08-05  5:26   ` Dmitry Antipov
2013-08-05 15:18     ` Eli Zaretskii [this message]
2013-08-05 16:00       ` Stefan Monnier
2013-08-05 16:52         ` Eli Zaretskii
2013-08-05 17:12           ` Dmitry Antipov
2013-08-05 17:17             ` Eli Zaretskii
2013-08-06  7:15           ` Dmitry Antipov
2013-08-06 14:51             ` Eli Zaretskii
2013-08-06 16:04               ` Yet another redisplay question Dmitry Antipov
2013-08-06 16:42                 ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83siyow4i6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).