From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64626 Path: news.gmane.org!not-for-mail From: Philipp Gesang Newsgroups: gmane.comp.tex.context Subject: Re: why lua? Date: Sat, 18 Dec 2010 14:06:21 +0100 Message-ID: <20101218130620.GC18627@aides> References: <20101217232724.GA17742@aides> <4D0BF64D.1090406@wxs.nl> <20101218110322.GB17742@aides> <4D0C9C8A.7060602@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0157968895==" X-Trace: dough.gmane.org 1292677597 8068 80.91.229.12 (18 Dec 2010 13:06:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 18 Dec 2010 13:06:37 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 18 14:06:33 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PTwUa-0006u8-7Q for gctc-ntg-context-518@m.gmane.org; Sat, 18 Dec 2010 14:06:32 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 045CDCA8CF; Sat, 18 Dec 2010 14:06:32 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id n81OLctWXSaH; Sat, 18 Dec 2010 14:06:31 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E5BF5CA923; Sat, 18 Dec 2010 14:06:28 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7279ECA923 for ; Sat, 18 Dec 2010 14:06:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id N82HSgddJ4KJ for ; Sat, 18 Dec 2010 14:06:25 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 402B5CA8CF for ; Sat, 18 Dec 2010 14:06:25 +0100 (CET) Original-Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBID6ODc004189 for ; Sat, 18 Dec 2010 14:06:24 +0100 Original-Received: from ix.urz.uni-heidelberg.de (cyrus-portal.urz.uni-heidelberg.de [129.206.100.176]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id oBID6NkL014863 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 18 Dec 2010 14:06:23 +0100 Original-Received: from extmail.urz.uni-heidelberg.de (extmail.urz.uni-heidelberg.de [129.206.100.140]) by ix.urz.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id oBID6MVX024683 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 18 Dec 2010 14:06:23 +0100 Original-Received: from localhost (mnhm-4d01089e.pool.mediaWays.net [77.1.8.158]) (authenticated bits=0) by extmail.urz.uni-heidelberg.de (8.13.4/8.13.1) with ESMTP id oBID6L6S002030 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 18 Dec 2010 14:06:22 +0100 In-Reply-To: <4D0C9C8A.7060602@wxs.nl> X-Operating-System: Linux aides 2.6.36-ARCH X-Polite-Request: "Please try to be nice, don't send html mail." User-Agent: Mutt/1.5.20 (2009-06-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=129.206.100.212; country=DE; region=01; city=Heidelberg; latitude=49.4167; longitude=8.7000; http://maps.google.com/maps?q=49.4167,8.7000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rDIB6orc - 9cfbad46a01c - 20101218 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:64626 Archived-At: --===============0157968895== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ctP54qlpMx3WjD+/" Content-Disposition: inline --ctP54qlpMx3WjD+/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2010-12-18 <12:35:38>, Hans Hagen wrote: > On 18-12-2010 12:03, Philipp Gesang wrote: > >Depending on whether you want to access the non-hashed content as > >well you might want to use the =E2=80=9Cnext=E2=80=9D iterator instead a= s it=E2=80=99s > >slightly faster (according to my tests, that is). You won=E2=80=99t get > >around the local variable, though; I have no clue and no time to > >check if it=E2=80=99s even technically feasible to iterate a hash table > >without accessing the hashes. >=20 > indeed, for k, v in next, sometable do ... is faster as it saves one > function call (i.e. pairs returning the next, table) >=20 > for indexed iteration using for i=3D1,n do ... is much faster than > ipairs as it involves no function calls Well, according to a quick test using =E2=80=9Cnext=E2=80=9D with hash tabl= es has only a *very* slight advantage (in time) over pairs. With arrays the difference to ipairs() is much higher; in mixed arrays/hashes it might turn out even higher. For tables I came up with this relation (=E2=80=9C<=E2=80=9D meaning less execution time than): while < for < repeat < next < ipairs where =E2=80=9Crepeat =E2=80=A6 until=E2=80=9D and =E2=80=9Cwhile =E2=80=A6= do =E2=80=A6 end=E2=80=9D check if the final index has been reached. But the difference between the three loops is rather neglegible. What always baffled me is that in the manual Roberto advertises ipairs() as the iterator of choice (at least in the v.5.0 doc). Compared to the other options using it is just, well, erratic. Regard, Philipp --=20 () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments --ctP54qlpMx3WjD+/ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk0MscwACgkQ02lYlJYWs9ICMwCgiwggy/rtZlWjVR8PO9Qm95ns JpQAn18hBz1ZVXojS3a9LxPQNfwHaDfO =N+TB -----END PGP SIGNATURE----- --ctP54qlpMx3WjD+/-- --===============0157968895== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0157968895==--