unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* inlining enabled in guile-vm: things get faster
@ 2008-05-25 21:41 Andy Wingo
  2008-05-26  7:55 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Wingo @ 2008-05-25 21:41 UTC (permalink / raw)
  To: guile-devel

Hello!

So it turns out that inlining of a number of operations was disabled in
guile-vm, from `apply' to `=' and other such things. I fixed this, as a
result of some profiling, and fixed some other things that showed up in
the profiles. The result is that e.g. the fibo test went from being
twice as slow as the interpreter to almost four times as fast, with no
change in its source code.

This is really interesting for me: how to make code faster, without
actually touching the code itself.

Anyway, available in my repo. Since then I've noticed that procedure
documentation doesn't show up in the compiled output. This breaks
`,help', among other things. Will be working on that and other
source-level debugging tasks, but probably will be a week and a half
before I can get back to this.

Happy hacking!

Andy

The following changes since commit 5feb8b6529f0bff937bd4504b6dd23e60bf65ac1:
  Andy Wingo (1):
        update news

are available in the git repository at:

  http://wingolog.org/git/guile-vm.git master

Andy Wingo (4):
      enable inlining; speed!
      Speed up the self-tail-recursive case (1x->2x)
      add inline macros for zero? and 1-
      Updated loop disassembly

 benchmark/lib.scm                    |  115 ++++++--------
 module/language/scheme/translate.scm |   13 +-
 module/system/base/compile.scm       |    3 +-
 module/system/il/Makefile.am         |    2 +-
 module/system/il/compile.scm         |   17 +-
 module/system/il/ghil.scm            |   23 +---
 module/system/il/inline.scm          |  206 +++++++++++++++++++++++
 module/system/il/macros.scm          |  302 ----------------------------------
 module/system/repl/repl.scm          |    2 +
 module/system/vm/Makefile.am         |    2 +-
 module/system/vm/assemble.scm        |    6 +-
 module/system/vm/bootstrap.scm       |   39 +++++
 module/system/vm/core.scm            |   16 +-
 module/system/vm/frame.scm           |    6 +-
 src/guilec.in                        |    3 +-
 src/vm.c                             |    4 +-
 src/vm_engine.h                      |   14 +-
 17 files changed, 338 insertions(+), 435 deletions(-)
 create mode 100644 module/system/il/inline.scm
 delete mode 100644 module/system/il/macros.scm
 create mode 100644 module/system/vm/bootstrap.scm
-- 
http://wingolog.org/




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

* Re: inlining enabled in guile-vm: things get faster
  2008-05-25 21:41 inlining enabled in guile-vm: things get faster Andy Wingo
@ 2008-05-26  7:55 ` Ludovic Courtès
       [not found]   ` <7cc52ff20805260145o6ed917f4wafa617a5e656e0a3@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2008-05-26  7:55 UTC (permalink / raw)
  To: guile-devel

Hi,

Andy Wingo <wingo@pobox.com> writes:

> So it turns out that inlining of a number of operations was disabled in
> guile-vm, from `apply' to `=' and other such things.

That's nice, but it reminds me of that discussion we had when I
experimented with similar things in the evaluator [0].  I think it's
important to optimize the general R5RS-compatible case, rather than
start relying on non-standard behavior for speed.

Thanks,
Ludovic.

[0] http://thread.gmane.org/gmane.lisp.guile.devel/6043





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

* Fwd: inlining enabled in guile-vm: things get faster
       [not found]   ` <7cc52ff20805260145o6ed917f4wafa617a5e656e0a3@mail.gmail.com>
@ 2008-05-26  8:46     ` Andy Wingo
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Wingo @ 2008-05-26  8:46 UTC (permalink / raw)
  To: guile-devel

Forwarding to the list. I'm temporarily on gmail, on which I'm a newb, sorry :)


---------- Forwarded message ----------
From: Andy Wingo <wingo@pobox.com>
Date: Mon, May 26, 2008 at 10:45 AM
Subject: Re: inlining enabled in guile-vm: things get faster
To: Ludovic Courtès <ludo@gnu.org>


Hi!

On Mon, May 26, 2008 at 9:55 AM, Ludovic Courtès <ludo@gnu.org> wrote:
> Andy Wingo <wingo@pobox.com> writes:
>
> > So it turns out that inlining of a number of operations was disabled in
> > guile-vm, from `apply' to `=' and other such things.
>
> That's nice, but it reminds me of that discussion we had when I
> experimented with similar things in the evaluator [0].  I think it's
> important to optimize the general R5RS-compatible case, rather than
> start relying on non-standard behavior for speed.

Oh I think you're right, definitely. But we have two things here: one,
some of these operations are fundamental, like `apply'. Two, the
functions that I inlined are all implemented in C, which is a form of
the hack that you refer to; basically, these inlines make those C
functions compile to code that doesn't have to leave the VM -- as if
they were implemeted in Scheme at the beginning. Also, I would say
that `+' is a valid instruction, wouldn't you?

(Also, this machinery already existed in macros.scm, but it wasn't
being plugged in.)

So I think that we're on the same page :)

Andy




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

end of thread, other threads:[~2008-05-26  8:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-25 21:41 inlining enabled in guile-vm: things get faster Andy Wingo
2008-05-26  7:55 ` Ludovic Courtès
     [not found]   ` <7cc52ff20805260145o6ed917f4wafa617a5e656e0a3@mail.gmail.com>
2008-05-26  8:46     ` Fwd: " Andy Wingo

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