From: Jan Wedekind <jan@wedesoft.de>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guile-user@gnu.org
Subject: Re: "AIscm" array JIT
Date: Fri, 10 Jun 2016 17:03:22 +0100 (BST) [thread overview]
Message-ID: <alpine.DEB.2.11.1606101700420.7182@wedemob> (raw)
In-Reply-To: <8760thyxq3.fsf@gnu.org>
On Fri, 10 Jun 2016, Ludovic Courtès wrote:
> Jan Wedekind <jan@wedesoft.de> skribis:
>
>> Here is an example adding an integer to each element of a 2D array
>> and returning the result:
>>
>> scheme@(guile-user)> (use-modules (oop goops) (aiscm jit) (aiscm int)
>> (aiscm pointer) (aiscm sequence))
>> scheme@(guile-user)> (+ (arr (2 3 5) (7 11 13)) 3)
>> $1 = #<sequence<sequence<int<8,unsigned>>>>:
>> ((5 6 8)
>> (10 14 16))
>>
>> The fallback method for the GOOPS generic "+" adds a JIT compiled
>> plus operation for the specific array types to the generic and then
>> calls "+" again.
>
> Woow, exciting stuff! It can surely make a different for number
> crunching applications.
>
> Ludo’.
Yes, here are some examples with empty arrays and arrays with 250,000
elements. I hope that the upcoming Guile version 2.2 will help increase
performance as well.
$ make bench
Making bench in bench
make[1]: Entering directory '/home/jan/test/aiscm/bench'
LD_LIBRARY_PATH=./.libs:/usr/local/lib GC_INITIAL_HEAP_SIZE=1G GC_USE_ENTIRE_HEAP=Y /usr/bin/guile bench.scm
user system total real
Guile GOOPS method dispatch 0.000040 0.000000 0.000040 ( 0.000040)
Guile make empty sequence 0.000150 0.000000 0.000150 ( 0.000140)
Guile allocate memory 0.000190 0.000000 0.000190 ( 0.000200)
Guile negate empty sequence 0.001580 0.000110 0.001690 ( 0.001690)
Guile make sequence 0.000230 0.000010 0.000240 ( 0.000240)
Guile negate sequence 0.002400 0.000930 0.003330 ( 0.003350)
C allocate memory 0.000060 0.000000 0.000060 ( 0.000060)
C negate empty sequence 0.000030 0.000000 0.000030 ( 0.000030)
C negate sequence 0.000730 0.000000 0.000730 ( 0.000720)
make[1]: Leaving directory '/home/jan/test/aiscm/bench'
Regards
Jan
next prev parent reply other threads:[~2016-06-10 16:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-08 21:16 "AIscm" array JIT Jan Wedekind
2016-06-09 9:02 ` tomas
2016-06-09 11:48 ` Jan Wedekind
2016-06-10 13:33 ` Ludovic Courtès
2016-06-10 16:03 ` Jan Wedekind [this message]
2016-06-10 21:48 ` Arne Babenhauserheide
2016-06-11 7:32 ` Jan Wedekind
2016-06-10 17:38 ` Nala Ginrut
2016-06-11 1:42 ` Basa Centro
2016-06-11 12:22 ` Jan Wedekind
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=alpine.DEB.2.11.1606101700420.7182@wedemob \
--to=jan@wedesoft.de \
--cc=guile-user@gnu.org \
--cc=ludo@gnu.org \
/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).