[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Sieve of Eratosthenes performance question
- From: "Shoaib Meenai" <shobiz91@...>
- Date: Wed, 6 Jun 2007 23:27:27 +0500
On 6/6/07, Philippe Lhoste <PhiLho@gmx.net> wrote:
... I believe the difference is because I made 'composite' an array with
contiguous numerical indexes, with optimized access in Lua 5.1 (direct
offset computing), while in the previous code, Lua probably has to make
more complex tests (hashing the index?) to see if the slot is empty ...
Might be a stupid question, but would the optimization apply even if
the first index was, say, 1296?