emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Slow image display over network


From: Lars Magne Ingebrigtsen
Subject: Slow image display over network
Date: Fri, 24 Sep 2010 01:43:28 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

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.)
  address@hidden * Lars Magne Ingebrigtsen




reply via email to

[Prev in Thread] Current Thread [Next in Thread]