From xemacs-m  Wed Dec 18 16:40:31 1996
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
          by xemacs.cs.uiuc.edu (8.8.4/8.8.4) with ESMTP
	  id QAA06230 for <xemacs-beta@xemacs.org>; Wed, 18 Dec 1996 16:40:29 -0600 (CST)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.4/8.8.4)
	  id XAA01917; Wed, 18 Dec 1996 23:40:29 +0100 (MET)
Sender: hniksic@public.srce.hr
To: xemacs-beta@xemacs.org
Subject: Inserting into a buffer.
X-URL: ftp://gnjilux.cc.fer.hr/pub/unix/util/wget/
X-Attribution: Hrv
X-Face: &}4JQk=L;e.~x+|eo]#DGk@x3~ed!.~lZ}YQcYb7f[WL9L'Z*+OyA\nAEL1M(".[qvI#a2E
 6WYI5>>e7'@_)3Ol9p|Nn2wNa/;~06jL*B%tTcn/XvhAu7qeES0\|MF%$;sI#yn1+y"
From: Hrvoje Niksic <hniksic@srce.hr>
Organization: SRCE Zagreb, Croatia
Lines: 52
X-Newsreader: Red Gnus v0.76/XEmacs 19.14
Date: 18 Dec 1996 23:40:28 +0100
Message-ID: <kig916v1noj.fsf@jagor.srce.hr>

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."

