lua-users home
lua-l archive

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


On Friday 21 January 2011 03:48:02 Axel Kittenberger wrote:
> Ah, a sieve of eratosthenes (there are various ways to get primes). I
> suppose you will find a considerable perfomance increase (native and
> jit) if you use "candidate" as a local variable you pass as argument
> and return value to find_next_candidate() instead of storing it as
> "candidate" key in the prime array.

Is table lookup really more expensive than passing in as an arg and passing 
back as a return? Ugh!

Maybe I'll try it.

You know what I might try someday? Make a C module to store each number in a 
bit instead of a byte.

I had some pretty fast prime generators here:

http://www.troubleshooters.com/codecorn/primenumbers/primenumbers.htm

But I wasn't using an interpreter :-)

SteveT
 
Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt