[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Speed of # operator (Was: ipairs in Lua 5.3.0-alpha)
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 15 Aug 2014 08:51:49 +0200
2014-08-15 3:43 GMT+02:00 Jan Behrens <jbe-lua-l@public-software-group.org>:
> Here, t->sizearray is not equal to #t, is it?
Oops, you are right.
Still, as Roberto pointed out [1], the O(log n) cost of #t (which
is all in C, no calls, only macros -- this I have checked!) is
likely to be less than the O(1) cost of a Lua function call.
[1] http://lua-users.org/lists/lua-l/2014-08/msg00421.html