ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Philipp Gesang <pgesang@ix.urz.uni-heidelberg.de>
Subject: Re: why lua?
Date: Sat, 18 Dec 2010 14:20:46 +0100	[thread overview]
Message-ID: <4D0CB52E.2040305@wxs.nl> (raw)
In-Reply-To: <20101218130620.GC18627@aides>

On 18-12-2010 2:06, Philipp Gesang wrote:

> 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.

I did lots of testing (an doptimizing) in critical code but in practice 
one will not notice much difference in a mkiv run. Actually, I changed 
all pairs, ipairs as there was a temporary intention to remove them from 
the lua core.

btw, in for i=1,#t do ... the #t is also a function call (so having many 
in these t[#t+1] = ... cases is also slower but again, seldom noticeable 
as lua in general is so fast

a similar dicussion can be held for strings being hashed but again the 
penalty is neglectable esp if one takes into account that strings only 
have one instance and compare real fast (pointer comparison); in mkiv / 
luatex we have lots of strings (keys, identical values, etc) and it 
really pays off to have them hashed

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


  reply	other threads:[~2010-12-18 13:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17 15:20 Jonas Stein
2010-12-17 21:46 ` Martin Schröder
2010-12-17 22:35 ` Philipp A.
2010-12-17 22:51   ` Hans Hagen
2010-12-18  8:35     ` luigi scarso
2010-12-17 22:48 ` Hans Hagen
2010-12-17 23:27 ` Philipp Gesang
2010-12-17 23:46   ` Hans Hagen
2010-12-18  0:50     ` Philipp A.
2010-12-18  5:56       ` Aditya Mahajan
2010-12-18 11:03       ` Philipp Gesang
2010-12-18 11:35         ` Hans Hagen
2010-12-18 13:06           ` Philipp Gesang
2010-12-18 13:20             ` Hans Hagen [this message]
2010-12-18 14:17               ` Philipp Gesang
2010-12-18 18:54                 ` Hans Hagen
2010-12-18 11:31       ` Taco Hoekwater
2010-12-18 13:04       ` Hans Hagen
2010-12-18 13:18         ` luigi scarso
2010-12-18 13:24           ` Hans Hagen

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

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

  git send-email \
    --in-reply-to=4D0CB52E.2040305@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    --cc=pgesang@ix.urz.uni-heidelberg.de \
    /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 NNTP newsgroup(s).