unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Jason Rumney <jasonr@gnu.org>
Cc: schierlm@gmx.de, 3208@emacsbugs.donarmstrong.com
Subject: bug#3208: 23.0.93; Memory full / crash when displaying lots of characters from a	large	font (like Arial Unicode or Code2000) which is not explicitly	selected (on Win32)
Date: Wed, 24 Jun 2009 20:45:35 +0900	[thread overview]
Message-ID: <E1MJQv1-0005pp-2K@etlken> (raw)
In-Reply-To: <4A4201EF.7000901@gnu.org> (message from Jason Rumney on Wed, 24 Jun 2009 18:37:35 +0800)

In article <4A4201EF.7000901@gnu.org>, Jason Rumney <jasonr@gnu.org> writes:

> Kenichi Handa wrote:
> > Although I still can't reproduce the problem (except for the
> > very slowness redisplay), I noticed some inefficiency in
> > fontset_font.  So, I've installed an improvement in the
> > TRUNK.  As a result, in the case of inserting many #x2203,
> > the redisplay got faster.

> The memory full problem is still there. I am surprised you don't see it 
> if you are seeing the slowness, since if things were working correctly, 
> only the first character displayed should be slow while the fonts are 
> searched, subsequent insertion of the same character should reuse the 
> cached font.

Even if Emacs once finds a font for a specific character C,
it doesn't directly cache the font for C.  Instead, the font
is recorded in a font-group that is shared with the other
characters (in a fontset).  So, each time we display C, we
must find a font that can display C within the cached fonts.
Of course, this process is, I think, far faster than
font-listing and opening, it is not instant especially when
the target font is at the end of the font-group.

The recipe of the original report inserts a very long line.
In that case, when Emacs displays a character at the end of
line, Emacs tries to check fonts of all characters in the
line.  This takes considerable amount of time (in my case 4
seconds before my patch and 2.5 seconds after the patch)
even if the font is cached.

> Your change seems to have reduced the first time display of etc/HELLO 

Actually it should reduce the second time display of a
specific group of characters.  But, as HELLO file contains
many different characters belonging to the same group,
display of some characters gets faster if a character of the
same group is already shown.

> from 12 seconds for the uniscribe backend to 10 seconds, vs 2 seconds 
> for the gdi backend and Emacs 22 (though only uniscribe can display the 
> complex scripts correctly). Subsequent redisplays are near 
> instantaneous, so it still seems to be searching for fonts rather than 
> displaying them that takes the time.

Anyway, it is not good to use HELLO file for comparing
because Emacs 23 knows more kinds of fonts can display a
specific character and thus tries more fonts.  So, it takes
more time to conclude that you system doesn't have a font
for that specific character.

---
Kenichi Handa
handa@m17n.org





  reply	other threads:[~2009-06-24 11:45 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4AAF9D6C.1040303@gnu.org>
2009-05-04 18:26 ` bug#3208: 23.0.93; Memory full / crash when displaying lots of characters from a large font (like Arial Unicode or Code2000) which is not explicitly selected (on Win32) Michael Schierl
2009-05-05 15:25   ` Jason Rumney
2009-05-05 15:46     ` Jason Rumney
2009-05-19  2:13     ` Kenichi Handa
2009-06-18  5:29       ` Jason Rumney
2009-06-22  5:47       ` Jason Rumney
2009-06-22 11:22         ` Kenichi Handa
2009-06-22 11:51           ` Jason Rumney
2009-06-22 12:51             ` Kenichi Handa
2009-06-22 13:05               ` Jason Rumney
2009-06-22 14:01                 ` bug#3650: M-x gdb unusable on Windows Jason Rumney
2009-06-23  1:59                   ` Kenichi Handa
2009-06-23  3:37                     ` Dan Nicolaescu
2009-06-23  6:22                     ` Nick Roberts
2009-06-23  7:38                       ` Kenichi Handa
2009-06-23  6:09                   ` Nick Roberts
2009-06-23  7:59                     ` Jason Rumney
2009-06-23 13:22                     ` Kenichi Handa
2009-06-23 17:08                       ` Dan Nicolaescu
2009-06-25  5:50                       ` Kenichi Handa
2009-06-25  6:13                         ` Nick Roberts
2009-06-25  7:51                           ` Kenichi Handa
2019-11-02  6:04                   ` Stefan Kangas
2019-11-02  8:41                     ` Eli Zaretskii
2022-04-13  0:40                       ` Lars Ingebrigtsen
2009-06-24  4:26                 ` bug#3208: 23.0.93; Memory full / crash when displaying lots of characters from a large font (like Arial Unicode or Code2000) which is not explicitly selected (on Win32) Kenichi Handa
2009-06-24 10:37                   ` Jason Rumney
2009-06-24 11:45                     ` Kenichi Handa [this message]
2009-06-24 10:43                   ` Jason Rumney
2009-06-24 11:55                     ` Kenichi Handa
     [not found]                       ` <4A422909.9060800@gnu.org>
2009-06-25  8:10                         ` Kenichi Handa
2009-06-25 13:21                           ` Jason Rumney
2009-06-26  1:26                             ` Kenichi Handa
2009-06-26  5:54                               ` Jason Rumney
2009-06-26 13:12                                 ` Kenichi Handa
2009-07-02 12:13                               ` Kenichi Handa
2009-07-02 21:36                                 ` Stefan Monnier
2009-07-03  2:11                                   ` Kenichi Handa
2009-09-15 14:05   ` bug#3208: marked as done (23.0.93; Memory full / crash when displaying lots of characters from a large font (like Arial Unicode or Code2000) which is not explicitly selected (on Win32)) Emacs bug Tracking System
2009-05-06 23:11 bug#3208: 23.0.93; Memory full / crash when displaying lots of characters from a large font (like Arial Unicode or Code2000) which is not explicitly selected (on Win32) Chong Yidong

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=E1MJQv1-0005pp-2K@etlken \
    --to=handa@m17n.org \
    --cc=3208@emacsbugs.donarmstrong.com \
    --cc=jasonr@gnu.org \
    --cc=schierlm@gmx.de \
    /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).