lua-users home
lua-l archive

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


A little more benchmark information:

If one removes the is_odd test, then LuaJIT sees a 10x improvement in the open coded case. Presumably this is because it essentially just stops branching during the loop. The sequence library code also sees an improvement (not quite 2x), but that means that the comparison between the two cases is now even worse.

I then tried replacing the varargs in the sequence library with specific numbers of arguments. Interestingly, the results were similar whether the argument count was 1 or 2 -- probably because the unused arguments get optimized away -- but the execution time actually got worse by a factor of more than 2. What's more in these cases, removing the filter step made the results still worse.

Finally, running with the JIT turned off delivered consistently better results for the sequence code cases. The margins were small for the cases with varargs but were huge (nearly 6x worse in some cases) for the cases without varargs.

Benchmark code available upon request.

Mark