lua-users home
lua-l archive

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


> > 
> > Both runs on the same speed and profiling tells that most time spent in
> > a [for] loop.

As it turns out, my profiling was a bit wrong.
But stills, the results are rather close.


> or even better, make:
> 		local t = {}
> 		for i = n1, n2 do
> 			t[i] = i
> 		end
> 		return table.concat(t, ",", n1, n2)

> a little faster, doing less computing...

> Tell me if it is better, using your profiling.

On my data (the most typical range is about 6 elements) it is a little
SLOWER than string.format or concat version: 0.18 vs 0.16 for 1000
calls on range with 6 elements and 0.72 vs 0.62 on range with 100
elements.


Thanks to all for the discussion, I think I'd stick with string.format
version.

-- 
Regards, max.