unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* reducing equality tests in displaying text
@ 2009-01-23  2:23 YAMAMOTO Mitsuharu
  2009-01-27  5:26 ` Kenichi Handa
  0 siblings, 1 reply; 12+ messages in thread
From: YAMAMOTO Mitsuharu @ 2009-01-23  2:23 UTC (permalink / raw)
  To: emacs-devel

I experimented with some performance tool and noticed that there were
frequent equality tests in displaying text.  I think most of them can
safely be reduced.

1. Each call of assoc_no_quit (charset,_encoding_charset_alist) in
   fontset.c can be replaced with assq_no_quit because
   Vfont_encoding_charset_alist is a symbol-keyed alist.

2. Also in fontset.c:

   472	  if (c >= 0)
   473	    font_group = char_table_ref_and_range (base_fontset, c, &from, &to);
   474	  else
   475	    font_group = FONTSET_FALLBACK (base_fontset);
   476	  if (NILP (font_group))
   477	    return Qnil;

   If `font_group' becomes Qnil in line 473, `from' and `to' are not
   used at all.  So the most of the task of char_table_ref_and_range
   is wasted for this case.  Because font_group == Qnil case happens
   frequently, the char_table_ref_and_range call should be avoided for
   this case.

3. Despite its argument name, `has_char' functions in font backend
   drivers are mostly called for a font object instead of a font
   entity.  Some font backend drivers could make use of this fact:
   e.g., ftfont_has_char can avoid frequent assoc_no_quit calls if
   struct ft_font has a reference to fc_charset in ft_face_cache.

BTW, I suspect Ffontset_font is broken.  I couldn't get any meaningful
result from (fontset-font t ?a), for example.

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-02-24 11:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).