unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Bill Zaumen <zaumen@pacbell.net>
Subject: X-windows performance over slow connections.
Date: Thu, 18 Jan 2007 15:35:54 -0800	[thread overview]
Message-ID: <1169163354.8383.55.camel@localhost> (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))))))

             reply	other threads:[~2007-01-18 23:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18 23:35 Bill Zaumen [this message]
2007-01-19 10:49 ` X-windows performance over slow connections 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1169163354.8383.55.camel@localhost \
    --to=zaumen@pacbell.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).