From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.devel Subject: Re: [sacha@myxomop.com: Re: XCreateFontSet called for each X window emacs frame is heavy] Date: Wed, 18 Jul 2007 10:21:27 +0900 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1184721717 16790 80.91.229.12 (18 Jul 2007 01:21:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 18 Jul 2007 01:21:57 +0000 (UTC) Cc: sacha@myxomop.com, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 18 03:21:55 2007 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 1IAyEj-0000Eu-7M for ged-emacs-devel@m.gmane.org; Wed, 18 Jul 2007 03:21:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IAyEi-00085v-7w for ged-emacs-devel@m.gmane.org; Tue, 17 Jul 2007 21:21:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IAyEg-00085p-0b for emacs-devel@gnu.org; Tue, 17 Jul 2007 21:21:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IAyEd-00085d-Hi for emacs-devel@gnu.org; Tue, 17 Jul 2007 21:21:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IAyEd-00085a-De for emacs-devel@gnu.org; Tue, 17 Jul 2007 21:21:47 -0400 Original-Received: from mx1.aist.go.jp ([150.29.246.133]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IAyEW-0002ZY-JR; Tue, 17 Jul 2007 21:21:41 -0400 Original-Received: from rqsmtp1.aist.go.jp (rqsmtp1.aist.go.jp [150.29.254.115]) by mx1.aist.go.jp with ESMTP id l6I1LZxs017617; Wed, 18 Jul 2007 10:21:35 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp1.aist.go.jp by rqsmtp1.aist.go.jp with ESMTP id l6I1LZRO018195; Wed, 18 Jul 2007 10:21:35 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp1.aist.go.jp with ESMTP id l6I1LS4q028531; Wed, 18 Jul 2007 10:21:28 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken.m17n.org with local (Exim 4.67) (envelope-from ) id 1IAyEJ-0007aQ-W9; Wed, 18 Jul 2007 10:21:28 +0900 In-reply-to: (message from Richard Stallman on Sun, 01 Jul 2007 12:32:13 -0400) User-Agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.0 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) X-detected-kernel: Solaris 8 (1) 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:75032 Archived-At: Sorry for the late response. In article , Richard Stallman writes: > Would someone please DTRT and ack? I have enclosed two messages. > Handa, this is in your area. > From: Alexander Kotelnikov > Date: Sat, 30 Jun 2007 16:39:36 +0400 > Subject: XCreateFontSet called for each X window emacs frame is heavy [...] > I think it is years now since I had noticed that every new emacs frame > either first or any subsequent makes all my computers feel bad. X > display stands still, cursor moves, but does not respond to clicks, > focus switches slowly. This continues of a split second, but it > hurts, I assure you. I do not know any other program, that causes > such problems. [...] > 2155 xfs = XCreateFontSet (FRAME_X_DISPLAY (f), > (gdb) > 2158 if (missing_list) > (gdb) > 2160 if (! xfs) > (gdb) p fontsetname > $1 = 0x85d0c80 "-monotype-courier > new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard, > - -monotype-courier > new-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-13-*-*-*-* > - -*-*-*,-*-*-*-*-*-*-13-*-*-*-*-*-*-*" I've never met such a problem, and it's very surprising that XCreateFontSet is that slow. Could you please compile the attached program (xfs.c), run it with these arguments: % ./xfs '-monotype-courier new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard,-monotype-courier new-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-*-*-*-*-13-*-*-*-*-*-*-*' %./xfs ''-monotype-courier new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard,-monotype-courier new-medium-r-normal-*-13-*-*-*-*-*-*-*,-*-*-medium-r-normal-*-13-*-*-*-*-*-*-*' %./xfs ''-monotype-courier new-medium-r-normal-*-13-92-100-100-m-80-adobe-standard,-monotype-courier new-medium-r-normal-*-13-*-*-*-*-*-*-*' and check if they are surely slow? And also please investigate why the following code in xic_create_xfontset doesn't find an already created fontset for the second and the other frames. /* See if there is another frame already using same fontset. */ FOR_EACH_FRAME (rest, frame) { struct frame *cf = XFRAME (frame); if (cf != f && FRAME_LIVE_P (f) && FRAME_X_P (cf) && FRAME_X_DISPLAY_INFO (cf) == FRAME_X_DISPLAY_INFO (f) && FRAME_XIC_BASE_FONTNAME (cf) && !strcmp (FRAME_XIC_BASE_FONTNAME (cf), base_fontname)) { xfs = FRAME_XIC_FONTSET (cf); break; } } --- Kenichi Handa handa@m17n.org --------------------- xfs.c ------------------------------- #include #include #include #include int main (int argc, char **argv) { Display *display; XFontSet xfs = NULL; char **missing_list = NULL; int missing_count; char *def_string; setlocale (LC_ALL, ""); display = XOpenDisplay (NULL); xfs = XCreateFontSet (display, argv[1], &missing_list, &missing_count, &def_string); if (! xfs) printf ("Fontset can't be created from \"%s\".\n", argv[1]); else { printf ("Fontset created successfully.\n"); if (missing_list) { int i; printf ("Missing fonts:\n"); for (i = 0; i < missing_count; i++) printf (" %s\n", missing_list[i]); XFreeStringList (missing_list); } XFreeFontSet (display, xfs); } XCloseDisplay (display); exit (0); }