lua-users home
lua-l archive

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

Vincent Penquerc'h wrote:
 >> did you make a C version of your algorithm and run it,

   I did a pretty literal C translation and got about 7 seconds on a P3-500
under Win98 where the original test ran in 48 seconds, the local variable
version ran in 38 seconds.  However, I made x a static array, so that might
invalidate the test if Lua's creation of that table is a significant
portion of the results - maybe I should've malloc'd.

  To Erik Hougaard:
    I think (not sure, check this) that x only needs to be init'ed up to
the sqrt of 100000 to do your sieve.  It might help to distinguish what's
being tested, if desired:  the sieve, or the table allocation.  (possible
idea for the second in your suite of tests?)