all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
To: Jason Rumney <jasonr@gnu.org>
Cc: eliz@gnu.org, lennart.borgman@gmail.com,
	monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: calculation of text extents [Re: Memory leak]
Date: Sat, 24 May 2008 11:30:40 +0900	[thread overview]
Message-ID: <E1JzjWq-0008DY-Gt@etlken.m17n.org> (raw)
In-Reply-To: <482D8332.5030908@gnu.org> (message from Jason Rumney on Fri, 16 May 2008 13:50:58 +0100)

In article <482D8332.5030908@gnu.org>, Jason Rumney <jasonr@gnu.org> writes:

> A while ago I noticed w32font_open being called multiple times for the 
> same font, so I suspect that we may be overlooking the font cache in 
> places and reopening fonts when we could be reusing an existing font.

With the recent fix of font-cache handling, I think the
number of calling `open' callback of a font-backend for the
same font is reduced.  Can you confirm that?

> There is another similar problem when we get text extents - each redraw 
> cycle can call w32font_text_extents a number of times for the same 
> glyph_string (from compute_glyph_string_overhangs, left_overwriting and 
> right_overwriting in quick succession in draw_glyphs, with nested 
> compute_overhangs_and_x within some of the if statements that cause 
> extra calls for preceding and following glyph_strings if there is 
> overhang, which there often is with antialising enabled). Perhaps this 
> operation is cheap with the X font backends, but on Windows it is 
> expensive (even with caching of metrics), and I suspect this is a major 
> cause of the slowdown reported by Windows users.

It seems that we can reduce the number of calling
`text_extents' callback by recording lbearing and rbearing
in struct glyph; which grows the size of that structure from
the current 32-byte to 36-byte.  I'm not sure how much that
change impacts the memory usage of Emacs, but isn't it worth
trying?

---
Kenichi Handa
handa@ni.aist.go.jp




  parent reply	other threads:[~2008-05-24  2:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15 22:50 Memory leak Stefan Monnier
2008-05-15 23:06 ` David Kastrup
2008-05-16  0:25   ` Lennart Borgman (gmail)
2008-05-16  8:35     ` Eli Zaretskii
2008-05-16  9:03       ` Juanma Barranquero
2008-05-16  9:25         ` Eli Zaretskii
2008-05-16  9:29           ` Juanma Barranquero
2008-05-16  9:46             ` Eli Zaretskii
2008-05-16  9:49             ` Juanma Barranquero
2008-05-16 20:13               ` Stephen J. Turnbull
2008-05-16 21:15                 ` [OT, silly] " Thomas Lord
2008-05-16 20:41           ` David Robinow
2008-05-16 21:36             ` Lennart Borgman (gmail)
2008-05-17  7:10             ` Eli Zaretskii
2008-05-16  9:43     ` Eli Zaretskii
2008-05-16 12:50       ` Jason Rumney
2008-05-19  8:05         ` Kenichi Handa
2008-05-19  8:45           ` YAMAMOTO Mitsuharu
2008-05-19 11:13             ` Kenichi Handa
2008-05-19 11:59               ` YAMAMOTO Mitsuharu
2008-05-23  2:24                 ` Kenichi Handa
2008-05-19 13:34           ` David Hansen
2008-05-19 19:42             ` David Hansen
2008-05-24  2:30         ` Kenichi Handa [this message]
2008-05-16  2:19   ` Stefan Monnier
2008-05-16  0:38 ` YAMAMOTO Mitsuharu
2008-05-17 15:16 ` Evil Boris
2008-05-17 19:11   ` Stephen J. Turnbull
2008-05-17 19:17     ` Eric Hanchrow
2008-05-18 11:26       ` Jan Djärv
2008-05-18 11:29         ` David Kastrup
2008-05-20  6:46           ` Jan Djärv
2008-05-18 13:34         ` Werner LEMBERG
2008-05-20  6:48           ` Jan Djärv
2008-05-19  2:44         ` Stephen J. Turnbull
2008-05-20  6:50           ` Jan Djärv
2008-05-21  6:10             ` Stephen J. Turnbull
2008-05-21 17:32               ` Stefan Monnier
2008-05-23 13:54   ` Evil Boris

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=E1JzjWq-0008DY-Gt@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@gnu.org \
    --cc=lennart.borgman@gmail.com \
    --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 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.