unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Optimizing memory footprint of bidi code
Date: Mon, 07 Jun 2010 19:10:08 -0400	[thread overview]
Message-ID: <E1OLlSK-0005ic-Tj@fencepost.gnu.org> (raw)
In-Reply-To: <jwvwruadfaa.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Mon, 07 Jun 2010 12:01:26 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> Date: Mon, 07 Jun 2010 12:01:26 -0400
> 
> > If so, this part is already taken care of.  If not, how to make this
> > type smaller without losing the benefits of an enumerated type (I
> > don't want to manipulate magic values or macros)?
> 
> I'm not sure what you're worried about.  What's wrong with adding a ":2"
> to the field?

Nothing's wrong.  I was saying that I would like to still be able to
use enumerated values and not just literal numerical constants.  But I
think Tom explained that with GCC this is not a problem.

> >   . struct bidi_it weighs in at 712 bytes on a 64-bit machine.  Can
> >     this amount of memory cause more frequent cache misses, with
> >     today's cache sizes?
> 
> If there's only one such struct used, then it's probably small enough
> that it doesn't matter.

There's only one such struct, it is part of struct it, the display
iterator used by redisplay.  Since windows are redisplayed one at a
time, there's only one instance of struct it and correspondingly only
one instance of struct bidi_it.

There's a cache inside bidi.c that caches bidi_it states.  That one
holds snapshots of struct bidi_it, but it is actively used only when
text actually needs reordering; otherwise, there's only one instance
there.  When reordering _is_ needed, the number of instances there
could be potentially large, but the intent of this cache is to prevent
repeated application of UAX#9 rules to characters we already saw and
processed.  This cache is on the heap.

> Of course, only measurements can give reliable answers.

I'd surely love to see some.



      reply	other threads:[~2010-06-07 23:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 14:30 Optimizing memory footprint of bidi code Eli Zaretskii
2010-06-07 15:14 ` Tom Tromey
2010-06-07 15:46   ` Andreas Schwab
2010-06-07 16:01 ` Stefan Monnier
2010-06-07 23:10   ` Eli Zaretskii [this message]

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=E1OLlSK-0005ic-Tj@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --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).