From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Slow image display over network Date: Fri, 24 Sep 2010 13:59:21 +0200 Organization: Organization?!? Message-ID: <87r5gj1heu.fsf@lola.goethe.zz> References: <87aan73bfk.fsf@uwakimon.sk.tsukuba.ac.jp> <87fwwz39ax.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285329583 27256 80.91.229.12 (24 Sep 2010 11:59:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Sep 2010 11:59:43 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 24 13:59:42 2010 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.69) (envelope-from ) id 1Oz6wH-0006Ma-Tc for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 13:59:42 +0200 Original-Received: from localhost ([127.0.0.1]:49474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oz6wH-0003eQ-GF for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 07:59:41 -0400 Original-Received: from [140.186.70.92] (port=56576 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oz6wA-0003dg-05 for emacs-devel@gnu.org; Fri, 24 Sep 2010 07:59:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oz6w8-0000z9-QK for emacs-devel@gnu.org; Fri, 24 Sep 2010 07:59:34 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:47304) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oz6w8-0000yx-A3 for emacs-devel@gnu.org; Fri, 24 Sep 2010 07:59:32 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Oz6w5-0006J2-EQ for emacs-devel@gnu.org; Fri, 24 Sep 2010 13:59:29 +0200 Original-Received: from p508ed727.dip.t-dialin.net ([80.142.215.39]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Sep 2010 13:59:29 +0200 Original-Received: from dak by p508ed727.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Sep 2010 13:59:29 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508ed727.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:qPjVdLIFMfXuP59Ny9ocnDaWMAk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:130759 Archived-At: Lars Magne Ingebrigtsen writes: > David Kastrup writes: > >> I don't think that this is relevant for remote operation. Emacs goes >> through a complex call chain for every single pixel of an X image in >> order to create it. Quite nonsensical. > > So are you suggesting that this can be fixed? You are in a twisty little maze of per-pixel procedure calls, all alike. Intermingled is the display alpha channel correction. Calculated fresh for every pixel. Of course it would make sense to batch all of this and do calls only for whole pictures or rectangles. That needs restructuring the code. If that is done well, it would make sense to route the color management on a Gtk target completely through Gdk: it does a good and well-optimized job with it. But you won't get much of an improvement if you call Gdk again for every pixel. >> Once it is through, it goes to the X server as one image if I am not >> mistaken, and gets moved into a pixmap (the Emacs image cache). So >> the worst that can happen is that it is in a format not best for >> remote transfer. > > First it's transferred pixel-by-pixel, and then it's transferred as an > image? No. First it is _created_ entirely on the client side using a call chain ending in Xlib calls, pixel-by-pixel for the whole call chain. Then the X Image (which is a client-side data structure) is transferred into a Pixmap (which is a server-side data structure) as one piece. So while Xlib is called over and over, the actual traffic to the X server should be tolerably optimized. All of this speaking just from memory of when I last looked at the Emacs 21 display engine. -- David Kastrup