all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* X-windows performance over slow connections.
@ 2007-01-18 23:35 Bill Zaumen
  2007-01-19 10:49 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Bill Zaumen @ 2007-01-18 23:35 UTC (permalink / raw)


This is really more of a feature request than a bug report.
emacs 21.4.1 (i486-pc-lunux-gnu, X toolkit, Xaw3d scroll bars)
and built on 2006-06-17.  I'm running ubuntu 6.06.

When I run ssh -C -X to connect to my home system over an ADSL
connection (unfortunately, in the 'slow' direction), it takes
well over a minute to start emacs.  I suspect this is due to the
menu, toolbar, scrollbars, and other X-windows features it uses.
Compression helps slightly, but is not quite enough.  I tried
to fix the problem by defining an environment variable named
EMACS_NET_PROFILE which, if defined, has the value "slow", "medium"
or "fast" to denote the speed of one's connection.  For slower
connections, it then turns off scroll bars, tool tips, menus, and
the tool bar based on the value of this variable.  Functionally,
this works as one would expect, however over a slow connection, I
can see the tool bar appear and then eventually go away: it seems
that the tool bar is created before my .emacs file is read, so
emacs takes about as long as before to get started.

It would be useful if one could use the environment variable I
defined or some other mechanism to suppress these features for
low bandwidth connections so that emacs starts faster.
You can set up SSH to pass particular environment variables so you 
could type something like

	EMACS_NET_PROFILE=slow ssh -C -X foo.net

and then just start emacs on foo.net, so that the normal keyboard
mappings work (e..g, the use of the ALT key as a META key on PC
keyboards).  This avoids the need to use special command-line options
(e.g., when emacs is started from a script).

I've enclosed the LISP code below - it is adequate for functional
testing but does not seem to be called early enough.

---------------------------------------------------

;;; When run remotely (e.g., via ssh -X) on a slow link such as
;;; a home ADSL link accessing the home machine from the Internet,
;;; emacs takes a long time to start up - over a minute.  The
;;; slow starting time is due primarily to X windows.  The
;;; function adapt-to-network-speed attempts to turn off emacs
;;; facilities that are nice to have but expensive to run on
;;; very slow network connections. It uses an environment
;;; variable EMACS_NET_PROFILE to determine the type of connection.
;;;
;;; There is no attempt to adapt to current network conditions,
;;; but rather a classification as to the type of network
;;; connection is made on the basis of the best-case or typical-case
;;; performance one can get, and as a result a statically determined
;;; value can be used.  These values are
;;;
;;;   "slow" - typical of dialup or ADSL in the 'slow' direction.
;;;   "medium" - perhaps 300 Kbits/sec in either direction.
;;;   "fast" - one Megabit per second or higher.
;;;
;;; It is possible to configure SSH to pass environment variables
;;; and this can defined in a configuration file.  The server will,
;;; however, have to be configured to accept the variables one wants
;;; to use.  See the manual pages for ssh_config and sshd_config.

(defun adapt-to-network-speed ()
  "Reads the environment variable EMACS_NET_PROFILE, whose values
are 'slow', 'medium', and 'fast', and configures emacs appropriately.
Intended to be called when emacs starts up with the environment variable
set on the basis of the type of network connection."

  (let ((speed (getenv "EMACS_NET_PROFILE")))
    (if speed
	(cond ((equal speed "slow")
	       (scroll-bar-mode -1)
	       (tool-bar-mode 0)
	       (tooltip-mode 0)
	       (menu-bar-mode 0))
	      ((equal speed "medium")
	       (tool-bar-mode 0))
	      ((equal speed "fast") t)
	      (t
	       (print 
		"Illegal value for environment variable EMACS_NET_PROFILE"
		t))))))

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

* Re: X-windows performance over slow connections.
  2007-01-18 23:35 X-windows performance over slow connections Bill Zaumen
@ 2007-01-19 10:49 ` Eli Zaretskii
  2007-01-20  6:17   ` Kevin Rodgers
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Eli Zaretskii @ 2007-01-19 10:49 UTC (permalink / raw)
  Cc: bug-gnu-emacs

> From: Bill Zaumen <zaumen@pacbell.net>
> Date: Thu, 18 Jan 2007 15:35:54 -0800
> 
> When I run ssh -C -X to connect to my home system over an ADSL
> connection (unfortunately, in the 'slow' direction), it takes
> well over a minute to start emacs.  I suspect this is due to the
> menu, toolbar, scrollbars, and other X-windows features it uses.
> Compression helps slightly, but is not quite enough.  I tried
> to fix the problem by defining an environment variable named
> EMACS_NET_PROFILE which, if defined, has the value "slow", "medium"
> or "fast" to denote the speed of one's connection.  For slower
> connections, it then turns off scroll bars, tool tips, menus, and
> the tool bar based on the value of this variable.  Functionally,
> this works as one would expect, however over a slow connection, I
> can see the tool bar appear and then eventually go away: it seems
> that the tool bar is created before my .emacs file is read, so
> emacs takes about as long as before to get started.

Did you try the advice in etc/PROBLEMS?  Look for "Improving
performance with slow X connections".

As for turning off various decorations, I think if you disable them in
your X resources, they will never come up.

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

* Re: X-windows performance over slow connections.
  2007-01-19 10:49 ` Eli Zaretskii
@ 2007-01-20  6:17   ` Kevin Rodgers
  2007-01-20 14:06     ` Eli Zaretskii
  2007-01-20 18:07     ` Richard Stallman
       [not found]   ` <mailman.3337.1169273850.2155.bug-gnu-emacs@gnu.org>
  2007-01-21  6:06   ` Bill Zaumen
  2 siblings, 2 replies; 10+ messages in thread
From: Kevin Rodgers @ 2007-01-20  6:17 UTC (permalink / raw)


Eli Zaretskii wrote:
>> From: Bill Zaumen <zaumen@pacbell.net>
>> Date: Thu, 18 Jan 2007 15:35:54 -0800
>>
>> When I run ssh -C -X to connect to my home system over an ADSL
>> connection (unfortunately, in the 'slow' direction), it takes
>> well over a minute to start emacs.  I suspect this is due to the
>> menu, toolbar, scrollbars, and other X-windows features it uses.
>> Compression helps slightly, but is not quite enough.  I tried
>> to fix the problem by defining an environment variable named
>> EMACS_NET_PROFILE which, if defined, has the value "slow", "medium"
>> or "fast" to denote the speed of one's connection.  For slower
>> connections, it then turns off scroll bars, tool tips, menus, and
>> the tool bar based on the value of this variable.  Functionally,
>> this works as one would expect, however over a slow connection, I
>> can see the tool bar appear and then eventually go away: it seems
>> that the tool bar is created before my .emacs file is read, so
>> emacs takes about as long as before to get started.
> 
> Did you try the advice in etc/PROBLEMS?  Look for "Improving
> performance with slow X connections".

It would be good if the exact X resource settings were listed there,
as they are for other problems.

> As for turning off various decorations, I think if you disable them in
> your X resources, they will never come up.

I think etc/PROBLEMS should show exactly how to disable them.

-- 
Kevin Rodgers
Denver, Colorado, USA

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

* Re: X-windows performance over slow connections.
  2007-01-20  6:17   ` Kevin Rodgers
@ 2007-01-20 14:06     ` Eli Zaretskii
  2007-01-22  6:53       ` Kevin Rodgers
  2007-01-20 18:07     ` Richard Stallman
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2007-01-20 14:06 UTC (permalink / raw)
  Cc: bug-gnu-emacs

> From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
> Date: Fri, 19 Jan 2007 23:17:22 -0700
> > 
> > Did you try the advice in etc/PROBLEMS?  Look for "Improving
> > performance with slow X connections".
> 
> It would be good if the exact X resource settings were listed there,
> as they are for other problems.
> 
> > As for turning off various decorations, I think if you disable them in
> > your X resources, they will never come up.
> 
> I think etc/PROBLEMS should show exactly how to disable them.

Patches are welcome.

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

* Re: X-windows performance over slow connections.
  2007-01-20  6:17   ` Kevin Rodgers
  2007-01-20 14:06     ` Eli Zaretskii
@ 2007-01-20 18:07     ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2007-01-20 18:07 UTC (permalink / raw)
  Cc: bug-gnu-emacs

    It would be good if the exact X resource settings were listed there,
    as they are for other problems.

Can you send a patch to list them?

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

* Re: X-windows performance over slow connections.
       [not found]   ` <mailman.3337.1169273850.2155.bug-gnu-emacs@gnu.org>
@ 2007-01-20 22:53     ` Tom Horsley
  0 siblings, 0 replies; 10+ messages in thread
From: Tom Horsley @ 2007-01-20 22:53 UTC (permalink / raw)


> >> ...When I run ssh -C -X to connect to my home system over an ADSL
> >> connection (unfortunately, in the 'slow' direction), it takes
> >> well over a minute to start emacs...

You probably want to investigate FreeNX - I don't know how they
do it, but NX connections seem almost like sitting in front of
the real machine (I suspect some kind of time warp technology
is involved to cancel out the long latency :-).

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

* Re: X-windows performance over slow connections.
  2007-01-19 10:49 ` Eli Zaretskii
  2007-01-20  6:17   ` Kevin Rodgers
       [not found]   ` <mailman.3337.1169273850.2155.bug-gnu-emacs@gnu.org>
@ 2007-01-21  6:06   ` Bill Zaumen
  2007-01-21 10:12     ` Andreas Schwab
  2 siblings, 1 reply; 10+ messages in thread
From: Bill Zaumen @ 2007-01-21  6:06 UTC (permalink / raw)
  Cc: bug-gnu-emacs

On Fri, 2007-01-19 at 12:49 +0200, Eli Zaretskii wrote:
> > From: Bill Zaumen <zaumen@pacbell.net>
> > Date: Thu, 18 Jan 2007 15:35:54 -0800
> > 
> > When I run ssh -C -X to connect to my home system over an ADSL
> > connection (unfortunately, in the 'slow' direction), it takes
> > well over a minute to start emacs.  I suspect this is due to the
> > menu, toolbar, scrollbars, and other X-windows features it uses.
> > Compression helps slightly, but is not quite enough.  I tried
> > to fix the problem by defining an environment variable named
> > EMACS_NET_PROFILE which, if defined, has the value "slow", "medium"
> > or "fast" to denote the speed of one's connection.  For slower
> > connections, it then turns off scroll bars, tool tips, menus, and
> > the tool bar based on the value of this variable.  Functionally,
> > this works as one would expect, however over a slow connection, I
> > can see the tool bar appear and then eventually go away: it seems
> > that the tool bar is created before my .emacs file is read, so
> > emacs takes about as long as before to get started.
> 
> Did you try the advice in etc/PROBLEMS?  Look for "Improving
> performance with slow X connections".
> 
> As for turning off various decorations, I think if you disable them in
> your X resources, they will never come up.

Thanks for your advice.  I looked through etc/PROBLEMS.  When I tried
the option --without-xim emacs reports that this is an unknown option
(I'm running ubuntu 6.0 (dapper), and I guess emacs was compiled
without XIM).  I couldn't find lbxproxy in a package search for
the version of ubuntu linux I'm running, but I was using the -C option
to ssh. I did find a bug report about lbxproxy being missing,
although lbxproxy was available in older versions.

Unfortunately, disabling decorations in X resources is a bit
problematic for what I'm doing: the problem came up when I was trying
to use a system at home from a coffee shop using a laptop, connecting
to my desktop system via ssh, but I would also use emacs on the laptop
to edit files there, so both were using the same X server, sometimes
at the same time.  Given that I'm using a slow connection infrequently,
making emacs less capable the rest of the time is not an attractive
option.

		Regards,

		Bill

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

* Re: X-windows performance over slow connections.
  2007-01-21  6:06   ` Bill Zaumen
@ 2007-01-21 10:12     ` Andreas Schwab
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Schwab @ 2007-01-21 10:12 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Bill Zaumen <zaumen@pacbell.net> writes:

> Unfortunately, disabling decorations in X resources is a bit
> problematic for what I'm doing: the problem came up when I was trying
> to use a system at home from a coffee shop using a laptop, connecting
> to my desktop system via ssh, but I would also use emacs on the laptop
> to edit files there, so both were using the same X server, sometimes
> at the same time.  Given that I'm using a slow connection infrequently,
> making emacs less capable the rest of the time is not an attractive
> option.

You can use a different resource name for the less capable instance, or
pass the modified resources directly on the command line with --xrm.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: X-windows performance over slow connections.
  2007-01-20 14:06     ` Eli Zaretskii
@ 2007-01-22  6:53       ` Kevin Rodgers
  2007-01-27 18:13         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Kevin Rodgers @ 2007-01-22  6:53 UTC (permalink / raw)


Eli Zaretskii wrote:
>> From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
>> Date: Fri, 19 Jan 2007 23:17:22 -0700
>>> Did you try the advice in etc/PROBLEMS?  Look for "Improving
>>> performance with slow X connections".
>> It would be good if the exact X resource settings were listed there,
>> as they are for other problems.
>>
>>> As for turning off various decorations, I think if you disable them in
>>> your X resources, they will never come up.
>> I think etc/PROBLEMS should show exactly how to disable them.
> 
> Patches are welcome.

*** etc/PROBLEMS~	Sat Dec 16 10:18:07 2006
--- etc/PROBLEMS	Sun Jan 21 23:49:18 2007
***************
*** 1263,1269 ****
      package.

   2) If the connection is very slow, you might also want to consider
!    switching off scroll bars, menu bar, and tool bar.

   3) Use ssh to forward the X connection, and enable compression on this
      forwarded X connection (ssh -XC remotehostname emacs ...).
--- 1263,1282 ----
      package.

   2) If the connection is very slow, you might also want to consider
!    switching off scroll bars, menu bar, and tool bar.  This can be
!    accomplished after the initial frame is displayed with these forms in
!    your .emacs file:
!
!    (scroll-bar-mode -1)
!    (menu-bar-mode -1)
!    (tool-bar-mode -1)
!
!    Or for quicker startup, with these X resources in your .Xdefaults
!    file:
!
!    Emacs.verticalScrollBars: off
!    Emacs.menuBar: off
!    Emacs.toolBar: off

   3) Use ssh to forward the X connection, and enable compression on this
      forwarded X connection (ssh -XC remotehostname emacs ...).


-- 
Kevin Rodgers
Denver, Colorado, USA

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

* Re: X-windows performance over slow connections.
  2007-01-22  6:53       ` Kevin Rodgers
@ 2007-01-27 18:13         ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2007-01-27 18:13 UTC (permalink / raw)
  To: Kevin Rodgers; +Cc: bug-gnu-emacs

> From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
> Date: Sun, 21 Jan 2007 23:53:35 -0700
> >>
> >>> As for turning off various decorations, I think if you disable them in
> >>> your X resources, they will never come up.
> >> I think etc/PROBLEMS should show exactly how to disable them.
> > 
> > Patches are welcome.
> 
> *** etc/PROBLEMS~	Sat Dec 16 10:18:07 2006
> --- etc/PROBLEMS	Sun Jan 21 23:49:18 2007
> ***************

Thanks, installed.

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

end of thread, other threads:[~2007-01-27 18:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-18 23:35 X-windows performance over slow connections Bill Zaumen
2007-01-19 10:49 ` Eli Zaretskii
2007-01-20  6:17   ` Kevin Rodgers
2007-01-20 14:06     ` Eli Zaretskii
2007-01-22  6:53       ` Kevin Rodgers
2007-01-27 18:13         ` Eli Zaretskii
2007-01-20 18:07     ` Richard Stallman
     [not found]   ` <mailman.3337.1169273850.2155.bug-gnu-emacs@gnu.org>
2007-01-20 22:53     ` Tom Horsley
2007-01-21  6:06   ` Bill Zaumen
2007-01-21 10:12     ` Andreas Schwab

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.