lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 2016-Jul-07 (Thu) at 09:08 (+0200), steve donovan wrote:

>> It would be cool if #t was O(1), however.

Steve,

   In theory, yes indeed, this would be nice and neat and clean.

   In practice, however, computing #t is blazingly fast.  In tests
   that I did some time ago ( Lua 5.2 ), with t being a sequence of
   10,000 elements, #t was computed 1,000,000 time in just 0.1 seconds.

   And that was on my little 2008-era netbook.

   Fast enough for me :-)

Joseph

------------------------------------------------------------------------
Joseph Manning / Computer Science / UCC Cork Ireland / manning@cs.ucc.ie
------------------------------------------------------------------------