emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiling byte code to native


From: Matthew Mundell
Subject: Compiling byte code to native
Date: 02 Jun 2004 12:43:41 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

The native compilation effort introduced earlier this year is archived
at http://www.mundell.ukfsn.org/native.  It can now compile all the
byte codes.


Here are three speed comparisons.  The commas in the middle column
separate runs.

               microseconds                    size in bytes
copy-tree
   Byte       21, 21, 20, 21, 18                    100
   Native     28, 14, 14, 16, 17                   2332

last
   Byte       15, 15, 16, 14, 15, 14                 65
   Native     12, 12, 12, 13, 19, 9                1605

native-test-info-eg-loop-small [1]
   Byte       187, 231, 233, 235, 235, 237, 485      13
   Native     113, 158, 164, 172, 173, 186, 225     302

So the speedup over byte code is available, but it seems that in most
cases it will be over-shadowed by the time spent in primitives.


It may be good to update the TODO entry:

** Investigate using GNU Lightning or similar system for incremental
   compilation of selected bytecode functions to subrs.  [There is an
   effort archived at http://www.mundell.ukfsn.org/native that can
   compile byte-code functions to native.]

In the future perhaps this work could be a base or reference for
adding compilation of functions to primitives.


Thanks.


[1] Passing 1000 to:

(defun native-test-info-eg-small (n)
  "Return time before and after N iterations of a loop.
This is the info manual's byte code speed example."
  (let ((t1 (current-time-string)))
    (while (> (setq n (1- n))
              0))
    (list t1 (current-time-string))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]