unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Compiling byte code to native
@ 2004-06-02 11:43 Matthew Mundell
  2004-06-02 14:22 ` Stefan Monnier
  2004-06-02 22:56 ` Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Matthew Mundell @ 2004-06-02 11:43 UTC (permalink / raw


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))))

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-03 10:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-02 11:43 Compiling byte code to native Matthew Mundell
2004-06-02 14:22 ` Stefan Monnier
2004-06-02 16:30   ` Matthew Mundell
2004-06-02 17:04     ` Stefan Monnier
2004-06-02 18:05       ` Matthew Mundell
2004-06-02 22:56 ` Richard Stallman
2004-06-03 10:32   ` Matthew Mundell

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