From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Llorens Newsgroups: gmane.lisp.guile.devel Subject: Fwd: array-copy! is slow & array-map.c Date: Sun, 7 Apr 2013 01:01:55 +0200 Message-ID: References: <81C95CA4-BD83-4DF6-B389-4610623DDE54@bluewin.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: multipart/mixed; boundary=Apple-Mail-229-435059345 X-Trace: ger.gmane.org 1365289335 2700 80.91.229.3 (6 Apr 2013 23:02:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Apr 2013 23:02:15 +0000 (UTC) Cc: guile-devel To: =?iso-8859-1?Q?Ludovic_Court=E8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Apr 07 01:02:19 2013 Return-path: Envelope-to: guile-devel@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 1UOc7i-0001kx-1z for guile-devel@m.gmane.org; Sun, 07 Apr 2013 01:02:14 +0200 Original-Received: from localhost ([::1]:40459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOc7h-0002g3-Nh for guile-devel@m.gmane.org; Sat, 06 Apr 2013 19:02:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:34360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOc7a-0002ep-B2 for guile-devel@gnu.org; Sat, 06 Apr 2013 19:02:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOc7U-0006C2-4G for guile-devel@gnu.org; Sat, 06 Apr 2013 19:02:06 -0400 Original-Received: from smtp4.infomaniak.ch ([2001:1600:2:5:92b1:1cff:fe01:18cc]:42162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOc7T-00069H-M1; Sat, 06 Apr 2013 19:02:00 -0400 Original-Received: from [10.0.1.10] (166.76.202.62.cust.bluewin.ch [62.202.76.166]) (authenticated bits=0) by smtp4.infomaniak.ch (8.14.5/8.14.5) with ESMTP id r36N1t4c003980 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Sun, 7 Apr 2013 01:01:56 +0200 X-Mailer: Apple Mail (2.1085) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:1600:2:5:92b1:1cff:fe01:18cc X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16176 Archived-At: --Apple-Mail-229-435059345 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii This patch replaces the scm_generalized_vector_get_handle() in the = rank-1 functions by scm_array_get_handle(). These calls came from the GVSET/GVREF code that I spliced in there, but = the arguments are known to be rank-1, so there's no reason not to use = the simpler call. Regards Daniel --Apple-Mail-229-435059345 Content-Disposition: attachment; filename=0001-Don-t-use-scm_generalized_vector_get_handle-in-array.patch Content-Type: application/octet-stream; name="0001-Don-t-use-scm_generalized_vector_get_handle-in-array.patch" Content-Transfer-Encoding: quoted-printable =46rom=2070fec2abb32b5d2546a40c70d15526b0ee5ccc20=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Daniel=20Llorens=20=0A= Date:=20Sun,=207=20Apr=202013=2000:04:35=20+0200=0ASubject:=20[PATCH]=20= Don't=20use=20scm_generalized_vector_get_handle()=20in=20array-map.c=0A=0A= *=20libguile/array-map.c:=20(rafill,=20racp,=20ramap,=20rafe):=20use=0A=20= =20scm_array_get_handle()=20instead=20of=20= scm_generalized_get_vector_handle().=0A---=0A=20libguile/array-map.c=20|=20= 12=20++++++------=0A=201=20file=20changed,=206=20insertions(+),=206=20= deletions(-)=0A=0Adiff=20--git=20a/libguile/array-map.c=20= b/libguile/array-map.c=0Aindex=202779458..1c443ac=20100644=0A---=20= a/libguile/array-map.c=0A+++=20b/libguile/array-map.c=0A@@=20-325,7=20= +325,7=20@@=20rafill=20(SCM=20dst,=20SCM=20fill)=0A=20=20=20= scm_t_array_handle=20h;=0A=20=20=20size_t=20i;=0A=20=20=20ssize_t=20inc;=0A= -=20=20scm_generalized_vector_get_handle=20(SCM_I_ARRAY_V=20(dst),=20= &h);=0A+=20=20scm_array_get_handle=20(SCM_I_ARRAY_V=20(dst),=20&h);=0A=20= =20=20i=20=3D=20h.base=20+=20h.dims[0].lbnd=20+=20SCM_I_ARRAY_BASE=20= (dst)*h.dims[0].inc;=0A=20=20=20inc=20=3D=20SCM_I_ARRAY_DIMS=20= (dst)->inc=20*=20h.dims[0].inc;=0A=20=0A@@=20-357,8=20+357,8=20@@=20racp=20= (SCM=20src,=20SCM=20dst)=0A=20=20=20ssize_t=20inc_s,=20inc_d;=0A=20=0A=20= =20=20dst=20=3D=20SCM_CAR=20(dst);=0A-=20=20= scm_generalized_vector_get_handle=20(SCM_I_ARRAY_V=20(src),=20&h_s);=0A-=20= =20scm_generalized_vector_get_handle=20(SCM_I_ARRAY_V=20(dst),=20&h_d);=0A= +=20=20scm_array_get_handle=20(SCM_I_ARRAY_V=20(src),=20&h_s);=0A+=20=20= scm_array_get_handle=20(SCM_I_ARRAY_V=20(dst),=20&h_d);=0A=20=0A=20=20=20= i_s=20=3D=20h_s.base=20+=20h_s.dims[0].lbnd=20+=20SCM_I_ARRAY_BASE=20= (src)=20*=20h_s.dims[0].inc;=0A=20=20=20i_d=20=3D=20h_d.base=20+=20= h_d.dims[0].lbnd=20+=20SCM_I_ARRAY_BASE=20(dst)=20*=20h_d.dims[0].inc;=0A= @@=20-665,7=20+665,7=20@@=20ramap=20(SCM=20ra0,=20SCM=20proc,=20SCM=20= ras)=0A=20=20=20scm_t_array_handle=20h0;=0A=20=20=20size_t=20i0,=20= i0end;=0A=20=20=20ssize_t=20inc0;=0A-=20=20= scm_generalized_vector_get_handle=20(SCM_I_ARRAY_V=20(ra0),=20&h0);=0A+=20= =20scm_array_get_handle=20(SCM_I_ARRAY_V=20(ra0),=20&h0);=0A=20=20=20i0=20= =3D=20h0.base=20+=20h0.dims[0].lbnd=20+=20SCM_I_ARRAY_BASE=20= (ra0)*h0.dims[0].inc;=0A=20=20=20inc0=20=3D=20SCM_I_ARRAY_DIMS=20= (ra0)->inc=20*=20h0.dims[0].inc;=0A=20=20=20i0end=20=3D=20i0=20+=20= n*inc0;=0A@@=20-678,7=20+678,7=20@@=20ramap=20(SCM=20ra0,=20SCM=20proc,=20= SCM=20ras)=0A=20=20=20=20=20=20=20scm_t_array_handle=20h1;=0A=20=20=20=20= =20=20=20size_t=20i1;=0A=20=20=20=20=20=20=20ssize_t=20inc1;=0A-=20=20=20= =20=20=20scm_generalized_vector_get_handle=20(SCM_I_ARRAY_V=20(ra1),=20= &h1);=0A+=20=20=20=20=20=20scm_array_get_handle=20(SCM_I_ARRAY_V=20= (ra1),=20&h1);=0A=20=20=20=20=20=20=20i1=20=3D=20h1.base=20+=20= h1.dims[0].lbnd=20+=20SCM_I_ARRAY_BASE=20(ra1)*h1.dims[0].inc;=0A=20=20=20= =20=20=20=20inc1=20=3D=20SCM_I_ARRAY_DIMS=20(ra1)->inc=20*=20= h1.dims[0].inc;=0A=20=20=20=20=20=20=20ras=20=3D=20SCM_CDR=20(ras);=0A@@=20= -738,7=20+738,7=20@@=20rafe=20(SCM=20ra0,=20SCM=20proc,=20SCM=20ras)=0A=20= =20=20scm_t_array_handle=20h0;=0A=20=20=20size_t=20i0,=20i0end;=0A=20=20=20= ssize_t=20inc0;=0A-=20=20scm_generalized_vector_get_handle=20= (SCM_I_ARRAY_V=20(ra0),=20&h0);=0A+=20=20scm_array_get_handle=20= (SCM_I_ARRAY_V=20(ra0),=20&h0);=0A=20=20=20i0=20=3D=20h0.base=20+=20= h0.dims[0].lbnd=20+=20SCM_I_ARRAY_BASE=20(ra0)*h0.dims[0].inc;=0A=20=20=20= inc0=20=3D=20SCM_I_ARRAY_DIMS=20(ra0)->inc=20*=20h0.dims[0].inc;=0A=20=20= =20i0end=20=3D=20i0=20+=20n*inc0;=0A--=20=0A1.8.2=0A=0A= --Apple-Mail-229-435059345 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail-229-435059345--