unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Slow image display over network
@ 2010-09-23 23:43 Lars Magne Ingebrigtsen
  2010-09-24  1:20 ` Leo
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-23 23:43 UTC (permalink / raw)
  To: emacs-devel

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.

So that's the behaviour I don't understand.  The first time you display
an image (over a high-latency X connection), it's really slow.  The next
time you display the same picture, it's really fast.

Emacs caches pictures internally, but that doesn't really explain the
incredible slowness the first time the picture is displayed remotely.
Or does it?

To me it seems like there might be a lot of ping-pong network chatter
when Emacs is instantiating pictures the first time.

In fact, just calling this takes several seconds remotely:

(image-size (create-image "/tmp/sleeve.jpg") t)

But only the first time.  

Hm.  Actually, `put-image' after the first `image-size' is
instantaneous.  Which sort of confirms my suspicions -- it's not the
remote image display per se that is latency-sensitive, but something
Emacs does while instantiating it.

Does anybody know what's causing this?  Or where I should poke around?

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2010-09-25  3:35 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-23 23:43 Slow image display over network Lars Magne Ingebrigtsen
2010-09-24  1:20 ` Leo
2010-09-24  7:58   ` Eli Zaretskii
2010-09-24  8:18     ` Leo
2010-09-24  1:47 ` Daniel Pittman
2010-09-24  7:31   ` Jan Djärv
2010-09-24 11:06   ` David Kastrup
2010-09-24 11:23   ` Lars Magne Ingebrigtsen
2010-09-24 11:51     ` David Kastrup
2010-09-24 11:54       ` Lars Magne Ingebrigtsen
2010-09-24 15:56         ` Chong Yidong
2010-09-24 12:05     ` joakim
2010-09-24 12:21       ` Leo
2010-09-24 12:56       ` Lars Magne Ingebrigtsen
2010-09-24 13:41         ` joakim
2010-09-24 15:55           ` Lars Magne Ingebrigtsen
2010-09-25  3:35     ` YAMAMOTO Mitsuharu
2010-09-24  6:25 ` Stephen J. Turnbull
2010-09-24  7:11   ` David Kastrup
2010-09-24 11:27     ` Lars Magne Ingebrigtsen
2010-09-24 11:59       ` David Kastrup
2010-09-24 12:57         ` Lars Magne Ingebrigtsen
2010-09-24 14:26         ` Jan Djärv
2010-09-24 11:25   ` Lars Magne Ingebrigtsen
2010-09-24 12:55   ` Lars Magne Ingebrigtsen
2010-09-24  7:44 ` joakim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).