[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaJIT & iterator sequences (a question for Mike Pall)
- From: Mark Hamburg <mark@...>
- Date: Sun, 3 Jan 2010 18:46:39 -0800
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.