all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: emacs-devel@gnu.org
Subject: Re: reducing equality tests in displaying text
Date: Thu, 29 Jan 2009 09:37:19 +0900	[thread overview]
Message-ID: <E1LSKuF-0005FF-G7@etlken> (raw)
In-Reply-To: <wl1vun23ss.wl%mituharu@math.s.chiba-u.ac.jp> (message from YAMAMOTO Mitsuharu on Wed, 28 Jan 2009 18:11:31 +0900)

In article <wl1vun23ss.wl%mituharu@math.s.chiba-u.ac.jp>, YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> writes:

> > Are you sure that those calls mostly return nil?  Could you
> > please check if this patch surely improve the performance?

> Here is the result.

> 	750.9 ms	emacs	mark_object	
> 	153.4 ms	libfreetype.6.dylib	tt_cmap4_char_map_binary	
> 	126.7 ms	emacs	Fgarbage_collect	
> 	106.8 ms	emacs	mark_vectorlike	
> 	64.8 ms	emacs	x_produce_glyphs	
> 	61.5 ms	emacs	char_table_ref	
> 	47.5 ms	emacs	fontset_find_font	
> 	33.3 ms	emacs	get_next_display_element	
> 	30.3 ms	emacs	face_for_char	
> 	29.3 ms	libXft.2.dylib	XftGlyphExtents	
> 	29.3 ms	emacs	assq_no_quit	
> 	29.3 ms	emacs	find_interval	
> 	27.3 ms	emacs	hash_lookup	
> 	26.3 ms	emacs	make_uninit_multibyte_string	
> 	25.2 ms	emacs	sub_char_table_ref	

Ummm, this result is surprising, but I found a bug in
fontset_get_font_group that is the culprit of so many calls
of char_table_ref_and_range.  I simply forgot to record the
result of previous call in the case of nil.  I should have
noticed it when you wrote that from and to were never used
in such a case.  :-(

Anyway, please try the new code.  I think that the calls of
char_rable_ref itself is reduced.

> > Hmmm.  I've just found that Xft has the function
> > XftCharExists now.  I remember that it didn't exist in a
> > rather old vesion.  Does your Xft library have this
> > function?

> It exists.  But it simply uses the `charset' member in struct _XftFont:

> _X_EXPORT FcBool
> XftCharExists (Display	    *dpy,
> 	       XftFont	    *pub,
> 	       FcChar32    ucs4)
> {
>     if (pub->charset)
> 	return FcCharSetHasChar (pub->charset, ucs4);
>     return FcFalse;
> }

> Is there any reason you prefer an Xft-level routine to
> fontconfig-level?  By adding some `FcCharSet *' member in struct
> ftfont as I said, you don't need to "override" `has_char' function in
> the xft driver, and the ftx driver can also benefit from it for free.

In ftfont.c, fontconfig is used only to list fonts.  The
other actual font driving is done directly by freetype.
Currently, the exception is ftfont_has_char, but I want to
find a way to avoid using fontconfig here too.

The reason why I want to keep this separation is that
listing fonts and using a font is different tasks, and, in
the future, I want to allow different combinations of them.

On the other hand, as Xft is so tightly combined with
fontconfig, and it already has `charset' member in XftFont
structure, it is nonsense not to utilize it.

---
Kenichi Handa
handa@m17n.org




  reply	other threads:[~2009-01-29  0:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-23  2:23 reducing equality tests in displaying text YAMAMOTO Mitsuharu
2009-01-27  5:26 ` Kenichi Handa
2009-01-28  0:12   ` YAMAMOTO Mitsuharu
2009-01-28  7:03     ` Kenichi Handa
2009-01-28  9:11       ` YAMAMOTO Mitsuharu
2009-01-29  0:37         ` Kenichi Handa [this message]
2009-01-29  1:46           ` YAMAMOTO Mitsuharu
2009-01-29  2:29             ` Kenichi Handa
2009-01-29  2:38               ` Jason Rumney
2009-01-29  2:46                 ` Kenichi Handa
2009-02-21  6:08             ` YAMAMOTO Mitsuharu
2009-02-24 11:58               ` Kenichi Handa

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=E1LSKuF-0005FF-G7@etlken \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /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.