From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan Wedekind Newsgroups: gmane.lisp.guile.user Subject: Re: "AIscm" array JIT Date: Fri, 10 Jun 2016 17:03:22 +0100 (BST) Message-ID: References: <8760thyxq3.fsf@gnu.org> Reply-To: Jan Wedekind NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1465574701 7453 80.91.229.3 (10 Jun 2016 16:05:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2016 16:05:01 +0000 (UTC) Cc: guile-user@gnu.org To: =?ISO-8859-15?Q?Ludovic_Court=E8s?= Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 10 18:04:53 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bBOvU-00025m-Qg for guile-user@m.gmane.org; Fri, 10 Jun 2016 18:04:52 +0200 Original-Received: from localhost ([::1]:43125 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBOvU-0005mL-3z for guile-user@m.gmane.org; Fri, 10 Jun 2016 12:04:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBOuB-0005Lg-UG for guile-user@gnu.org; Fri, 10 Jun 2016 12:03:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBOu8-0001EU-4M for guile-user@gnu.org; Fri, 10 Jun 2016 12:03:31 -0400 Original-Received: from basicbox4.server-home.net ([195.137.212.26]:43609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBOu7-0001Da-UH; Fri, 10 Jun 2016 12:03:28 -0400 Original-Received: from [10.10.10.250] (salt-ext.roke.co.uk [109.207.29.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by basicbox4.server-home.net (Postfix) with ESMTPSA id A29021530665; Fri, 10 Jun 2016 18:03:23 +0200 (CEST) X-X-Sender: jan@wedemob In-Reply-To: <8760thyxq3.fsf@gnu.org> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.137.212.26 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12608 Archived-At: On Fri, 10 Jun 2016, Ludovic Court=C3=A8s wrote: > Jan Wedekind 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 i= nt) >> (aiscm pointer) (aiscm sequence)= ) >> scheme@(guile-user)> (+ (arr (2 3 5) (7 11 13)) 3) >> $1 =3D #>>>: >> ((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=E2=80=99. Yes, here are some examples with empty arrays and arrays with 250,000=20 elements. I hope that the upcoming Guile version 2.2 will help increase=20 performance as well. $ make bench Making bench in bench make[1]: Entering directory '/home/jan/test/aiscm/bench' LD_LIBRARY_PATH=3D./.libs:/usr/local/lib GC_INITIAL_HEAP_SIZE=3D1G G= C_USE_ENTIRE_HEAP=3DY /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