unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andreas Rottmann <a.rottmann@gmx.at>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: Take some lowhanging fruit to speed up R6RS fixnum operations
Date: Wed, 30 Mar 2011 12:31:40 +0200	[thread overview]
Message-ID: <871v1onblf.fsf@gmx.at> (raw)
In-Reply-To: <m3ei5q89v1.fsf@unquote.localdomain> (Andy Wingo's message of "Tue, 29 Mar 2011 13:05:54 +0200")

Andy Wingo <wingo@pobox.com> writes:

> On Wed 23 Mar 2011 00:20, Andreas Rottmann <a.rottmann@gmx.at> writes:
>
>> In porting dorodango[0], I have noticed that Guile's R6RS fixnum
>> operations are quite slow; here's a patch to remedy that a bit.
>
> What is the state of things here?  I'm a bit lost in the discussion :)
>
> You said that decompressing the zip file takes 74 seconds with Guile as
> it is now.  What if you change to use Guile's arithmetic instead of
> fxops?  That would give is a good baseline so that we can know how much
> overhead the fxops have.
>
OK, here are a bunch of numbers that will hopefully help to determine
the desired course of action:

| Codebase         | fixnum? | fxxor | unzip |
|------------------+---------+-------+-------|
| vanilla          |    5.66 | 24.69 |  65.9 |
| generic          |    5.62 |  1.92 |   7.7 |
| smart            |    3.42 | 21.29 |  56.3 |
| smart + opt        |    3.42 |  6.99 |  21.9 |
| smart + opt-macros |     3.4 |  5.56 |  21.0 |
| vmop             |    1.78 | 18.83 |  47.9 |
| vmop+opt         |    1.77 |  3.94 |  14.1 |
| vmop+opt-macros  |    1.78 |   3.7 |  13.3 |

As you can see, in the "vanilla" case (i.e. current stable-2.0), it's
65.9 seconds -- I do not know where I got the 74 second number from,
perhaps it was from a profiling run.

The "generic" case is the one where all fixnum checks have been
eliminated, thus allowing the compiler to emit VM primitives for most of
the operations.

Now, with these baselines established, I implemented the following
optimizations, and benchmarked combinations of them as can be seen from
the above table.

-- 
Andreas Rottmann -- <http://rotty.yi.org/>



  parent reply	other threads:[~2011-03-30 10:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 23:20 Take some lowhanging fruit to speed up R6RS fixnum operations Andreas Rottmann
2011-03-22 23:20 ` [PATCH] " Andreas Rottmann
2011-03-24 21:51   ` Ludovic Courtès
2011-03-24 23:42     ` Andreas Rottmann
2011-03-25 12:16       ` Andreas Rottmann
2011-03-27 15:19         ` Ludovic Courtès
2011-03-27 22:20           ` Andreas Rottmann
2011-03-29 11:05 ` Andy Wingo
2011-03-30  1:37   ` Andreas Rottmann
2011-03-30 10:31   ` Andreas Rottmann [this message]
2011-03-30 10:58   ` Andreas Rottmann
2011-04-02 17:42     ` R6RS fixnum arithmetic optimizations Andreas Rottmann
2011-04-02 17:42       ` [PATCH 1/3] Add a few benchmarks for R6RS fixnum arithmetic Andreas Rottmann
2011-04-02 17:42       ` [PATCH 2/3] Several optimizations " Andreas Rottmann
2011-04-02 17:42       ` [PATCH 3/3] Add `fixnum?' VM primitive Andreas Rottmann
2011-04-04 21:53         ` Andy Wingo
2011-04-05  0:14           ` Andreas Rottmann
2011-04-06 12:42             ` define-inlinable Ludovic Courtès
2011-04-06 21:30               ` define-inlinable Andreas Rottmann
2011-04-06 22:24                 ` define-inlinable Ludovic Courtès
2011-04-11 16:56                   ` define-inlinable Andy Wingo
2011-04-11 20:01                     ` define-inlinable Ludovic Courtès
2011-04-11 21:05                       ` define-inlinable Andy Wingo
2011-04-11 22:11                         ` define-inlinable Andreas Rottmann
2011-04-07 15:57             ` [PATCH 3/3] Add `fixnum?' VM primitive Ludovic Courtès
2011-04-04 21:28     ` Take some lowhanging fruit to speed up R6RS fixnum operations Andy Wingo
2011-04-04 22:00       ` Andreas Rottmann
2011-04-04 22:12         ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871v1onblf.fsf@gmx.at \
    --to=a.rottmann@gmx.at \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).