[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is it supposed to be faster to call a C function than a Lua function when in Lua?
- From: Eric Wing <ewmailing@...>
- Date: Wed, 26 Jun 2013 23:48:01 -0700
On 6/26/13, Sean Conner <firstname.lastname@example.org> wrote:
> Some odd results. I thought that might be due to garbage collection (due
> to the how the C function is defined---check the code), so I reran the
> this time with some forced garbage collection before the tests:
Thanks for looking at this.
I also had wondered about garbage collection and you can see in my
code that I forced collection before the test and also timed the
garbage collection right after the tests to see if there was
sufficient garbage being generated. (There did not seem to be any.)
I also tried disabling the garbage collector during my benchmark, but
my timings came out the same.
> A better test might be a longer run to smooth out the jitters, and maybe
> subtract out the overhead of getting the time.
My results are pretty consistent. I run a loop from 1 to 10000000 so
the completion times are in seconds, which I think helps eliminates
variations due to other things that might be going on in the machine.
Beginning iPhone Games Development