lua-users home
lua-l archive

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


On Thu, Jan 5, 2017 at 6:07 AM, Martin <eden_martin_fuhrspam@gmx.de> wrote:

Concerning your algo, try sieve of Eratosthenes. Usually it's
right answer when we need to create table of primes for some segment.

 
Thanks!!!
Eratosthenes is 10 times faster (0.13 sec vs. 1.2 sec).
Now only 10% of test cases are failed due to timeout.
I need only 0.2 seconds more to complete all the tests!
All function calls inside loops are already inlined (that gave me 0.02 sec!).

New version of code:
http://pastebin.com/Xuf6FEJv

I need an idea to speed up the code by 2%.