lua-users home
lua-l archive

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


On Thu, Mar 16, 2017 at 8:28 PM, Chris Jones <cmsj@tenshu.net> wrote:

> Even if it was half, a million table inserts taking 0.01 or 0.02 seconds is, in probably the vast majority of cases, completely fine :)

Problem is, you have not measured the majority of cases. You measured your setup, which was completely arbitrary. You could have run the loop just a thousand times and concluded there had been no difference at all. Or you could have run the loop a trillion times, where "half the execution time" would have been very significant.

Another thing to remark on is that a typical OS has scheduling time slices in roughly the 10-100 ms range, and the difference that you measured falls within that range. Unless you have taken measures to filter out the scheduler-induced noise (which you have not mentioned), your result may be way off the mark.

Cheers,
V.