From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: Analysis of redisplay performance on Windows Date: Mon, 28 Jul 2008 18:48:56 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <87od4kuis1.fsf@stupidchicken.com> <488C45FF.2040509@gnu.org> <87tzebnizu.fsf@stupidchicken.com> <488CE8F6.5080001@gnu.org> <87iqurhupv.fsf@stupidchicken.com> <488CEE6B.6020600@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1217238622 27205 80.91.229.12 (28 Jul 2008 09:50:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Jul 2008 09:50:22 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Jason Rumney Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 28 11:51:11 2008 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.50) id 1KNPNe-0008Rx-TH for ged-emacs-devel@m.gmane.org; Mon, 28 Jul 2008 11:51:03 +0200 Original-Received: from localhost ([127.0.0.1]:55795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNPMj-0007wu-OJ for ged-emacs-devel@m.gmane.org; Mon, 28 Jul 2008 05:50:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNPLr-0007YA-Cc for emacs-devel@gnu.org; Mon, 28 Jul 2008 05:49:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNPLo-0007XO-TW for emacs-devel@gnu.org; Mon, 28 Jul 2008 05:49:10 -0400 Original-Received: from [199.232.76.173] (port=45317 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNPLo-0007X7-F6 for emacs-devel@gnu.org; Mon, 28 Jul 2008 05:49:08 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:57258) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KNPLh-00020v-GU; Mon, 28 Jul 2008 05:49:02 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 916F72C40; Mon, 28 Jul 2008 18:48:56 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.2.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-kernel: by monty-python.gnu.org: NetBSD 3.0 (DF) 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:101628 Archived-At: >>>>> On Mon, 28 Jul 2008 13:24:47 +0900, YAMAMOTO Mitsuharu said: >>>>> On Sun, 27 Jul 2008 22:53:47 +0100, Jason Rumney said: >> One difference between Emacs 22 and 23 is that we compute glyph >> indexes properly in Emacs 23, while on 22 we use unicode code >> points. Since we call font->encode_char once per character rather >> than for a whole run, the overhead of selecting fonts into the GC >> is multiplied. > According to the document below, Uniscribe seems to provide some > mechanism to defer heavy operations such as get_frame_dc and > SelectObject. > http://www.microsoft.com/typography/developers/uniscribe/uniscribe.htm#SCRIPT_CACHE The following document might be better. http://msdn.microsoft.com/en-us/library/ms776490.aspx Caching Uniscribe saves Unicode-to-glyph (cmap) mappings, glyph widths, and OpenType script shaping tables. A handle to the tables for a particular font of a particular size is called a "script cache". Many Uniscribe functions call for both an device context handle parameter and a SCRIPT_CACHE parameter. These functions look first for information through the script cache, using the device context only when required tables are not already cached. (snip) For ScriptShape and ScriptPlace, it is valid for the application to pass a null device context. Most often the call will succeed, as required tables are already cached. If the shaping or placement requires access to a device context, ScriptShape or ScriptPlace returns immediately with the E_PENDING error code. Then the application must select the font in the device context. For most applications, this helps performance by avoiding repeated preparation of a device context handle with calls to SelectObject. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp