From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Zaumen Newsgroups: gmane.emacs.bugs Subject: X-windows performance over slow connections. Date: Thu, 18 Jan 2007 15:35:54 -0800 Message-ID: <1169163354.8383.55.camel@localhost> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1169199547 7691 80.91.229.12 (19 Jan 2007 09:39:07 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 Jan 2007 09:39:07 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 19 10:39:05 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H7qD5-0008WB-Em for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jan 2007 10:38:59 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7qD4-00027i-PR for geb-bug-gnu-emacs@m.gmane.org; Fri, 19 Jan 2007 04:38:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7gmi-0002ab-Ju for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2007 18:35:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7gmh-0002ZW-RD for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2007 18:35:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7gmh-0002ZM-M5 for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2007 18:35:07 -0500 Original-Received: from [207.115.36.58] (helo=nlpi029.sbcis.sbc.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H7gmh-0002HG-A5 for bug-gnu-emacs@gnu.org; Thu, 18 Jan 2007 18:35:07 -0500 X-ORBL: [209.233.20.69] Original-Received: from [192.168.1.11] (adsl-209-233-20-69.dsl.snfc21.pacbell.net [209.233.20.69]) by nlpi029.sbcis.sbc.com (8.13.8 out.dk.spool/8.13.8) with ESMTP id l0INYqO6026765 for ; Thu, 18 Jan 2007 17:34:53 -0600 Original-To: bug-gnu-emacs@gnu.org X-Mailer: Evolution 2.6.1 X-Mailman-Approved-At: Fri, 19 Jan 2007 04:38:54 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:15536 Archived-At: 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))))))