From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Optimizing memory footprint of bidi code Date: Mon, 07 Jun 2010 19:10:08 -0400 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1275953128 3369 80.91.229.12 (7 Jun 2010 23:25:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 Jun 2010 23:25:28 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 08 01:25:27 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OLlh8-0008SU-LN for ged-emacs-devel@m.gmane.org; Tue, 08 Jun 2010 01:25:26 +0200 Original-Received: from localhost ([127.0.0.1]:51773 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLlh7-00021W-Vv for ged-emacs-devel@m.gmane.org; Mon, 07 Jun 2010 19:25:26 -0400 Original-Received: from [199.232.76.173] (port=40452 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OLlgz-0001xX-QL for emacs-devel@gnu.org; Mon, 07 Jun 2010 19:25:17 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1OLlSL-0000JR-Ds for emacs-devel@gnu.org; Mon, 07 Jun 2010 19:10:10 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:48887) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1OLlSL-0000JN-7O for emacs-devel@gnu.org; Mon, 07 Jun 2010 19:10:09 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OLlSK-0005ic-Tj; Mon, 07 Jun 2010 19:10:08 -0400 In-reply-to: (message from Stefan Monnier on Mon, 07 Jun 2010 12:01:26 -0400) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:125621 Archived-At: > From: Stefan Monnier > 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.