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 09:11:34 +0200 Organization: Organization?!? Message-ID: <87fwwz39ax.fsf@lola.goethe.zz> References: <87aan73bfk.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1285312321 20707 80.91.229.12 (24 Sep 2010 07:12:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 24 Sep 2010 07:12:01 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 24 09:11:59 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 1Oz2Rq-0005dF-UJ for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 09:11:59 +0200 Original-Received: from localhost ([127.0.0.1]:53195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oz2Rq-000840-1a for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 03:11:58 -0400 Original-Received: from [140.186.70.92] (port=35493 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oz2Rj-00083f-LN for emacs-devel@gnu.org; Fri, 24 Sep 2010 03:11:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oz2Ri-0005Zh-91 for emacs-devel@gnu.org; Fri, 24 Sep 2010 03:11:51 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:36133) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oz2Rh-0005ZS-Qw for emacs-devel@gnu.org; Fri, 24 Sep 2010 03:11:50 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Oz2Rd-0005Zd-AW for emacs-devel@gnu.org; Fri, 24 Sep 2010 09:11:45 +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 09:11:45 +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 09:11:45 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 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:PLaSku1z0cJopFkuF69lYpNXdlg= 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:130729 Archived-At: "Stephen J. Turnbull" writes: > Lars Magne Ingebrigtsen writes: > > One thing I've wondered about for a while, but has become more > > relevant lately (what with the web feeds in Gnus and stuff) is why > > image display is so slow over remote connections. > > > > Here's how to reproduce: > > > > 1) ssh somewhere that's far away, so that there's plenty of latency > > 2) open an Emacs over X 3) (put-image "/tmp/pretty-big-picture.jpg" > > (point)) > > > > Depending on how big the picture is, and what the latency is, this > > might take very long time. > > > > 4) switch to a different buffer > > > > This will be instantaneous. > > > > 5) switch back to the buffer where the picture is > > > > This will not be instantaneous, but it will be very fast. > > You do understand that 4 and 5 are probably not interesting, because > the *X server* creates a pixmap, and that will be available to Emacs > for reuse via an int-sized resource ID? > > That said, it has been alleged in the past that XEmacs instantiates > images more quickly than Emacs does. You might try benchmarking Emacs > against XEmacs; if Emacs performs comparably to XEmacs, while there > still may very well be a bug, it's probably pretty hard to fix since > two rather different implementations are showing the same performance > issue. 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. 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. I don't remember all too closely whether it is Xlib on the client side or the X server which does the conversion to an onscreen Pixmap from an XImage. In any case, that cost should be negligible in remote operations. -- David Kastrup