From xemacs-m  Thu Dec 19 05:53:06 1996
Received: from proxy1.ba.best.com (root@proxy1.ba.best.com [206.184.139.12])
          by xemacs.cs.uiuc.edu (8.8.4/8.8.4) with ESMTP
	  id FAA08246 for <xemacs-beta@xemacs.org>; Thu, 19 Dec 1996 05:53:06 -0600 (CST)
Received: from shellx.best.com (shellx.best.com [206.86.0.11]) by proxy1.ba.best.com (8.8.4/8.8.3) with SMTP id DAA25244; Thu, 19 Dec 1996 03:49:07 -0800 (PST)
Date: Thu, 19 Dec 1996 03:49:07 -0800 (PST)
From: Ben Wing <wing@best.com>
To: Hrvoje Niksic <hniksic@srce.hr>
cc: xemacs-beta@xemacs.org
Subject: Re: Inserting into a buffer.
In-Reply-To: <kig916v1noj.fsf@jagor.srce.hr>
Message-ID: <Pine.SGI.3.95.961219034733.22578D-100000@shellx.best.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

The culprit is surely silly.  Similar problems have happened before.

Someone please run Quantify or the like (Martin?) on this to find the
culprit.

On 18 Dec 1996, Hrvoje Niksic wrote:

> OK, the simple test of inserting stuff into a buffer (and I find it to
> be a *very* good real-life example) possibly shows a new dimension of
> XEmacs slowness, that unfortunately has (or should have) nothing to do
> with the redisplay engine.
> 
> The test runs on GNU Emacs 19.34 and XEmacs 19.14, both compiled with
> -O3 -msupersparc (gcc, of course).
> 
> The test is bench-mark-hrv, defined like this:
> 
> (defun bench-mark-hrv ()
>   (unwind-protect
>       (let ((a 100000))
>         (set-buffer (get-buffer-create "*tmp*"))
>         (erase-buffer)
>         (while (> a 0)
>           (insert "0123456789\n")
>           (setq a (1- a))))
>     (kill-buffer "*tmp*")))
> 
> This inserts 100,000 lines of "0123456789" (making 1,100,000 bytes
> buffer).  The result clearly shows that GNU Emacs is as much as 6 or 7
> times faster at this test.  This shouldn't deal with the display
> engine at all.
> 
> XEmacs 19.14:
> Function Name   Call Count  Elapsed Time  Average Time
> ==============  ==========  ============  ============
> bench-mark-hrv  10          76.555001000  7.6555001000   <= Inserting into a buffer
> 
> Emacs 19.34:
> Function Name   Call Count  Elapsed Time  Average Time
> ==============  ==========  ============  ============
> bench-mark-hrv  10          16.721052999  1.6721052999   <= Inserting into a buffer
> 
> Running these tests several times, and measuring the times by hand,
> repeated these results.
> 
> My conclusion is that it is not the display engine to blame for all
> the slowness -- if such a basic operation as buffer insertion is slow,
> it is obvious why the overall performance degrades.  :( Have I made a
> mistake somewhere?
> 
> P.S.
> GNU Emacs writes something to the effect of "Profiling is not
> available in this Emacs".  However, the correct value is written, and
> speed difference is so big that you don't need the profiler to see it.
> 
> -- 
> Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
> --------------------------------+--------------------------------
> "Psychos _do not_ explode when sunlight hits them."
> 

