[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: NIL in arith. and string op.
- From: "Nodir Temirhodzhaev" <tnodir@...>
- Date: Tue, 06 Jan 2004 10:17:25 +0300
Some tests:
-- Or
local a = {}
for i = 1, 5000 do
for j = 1, 1000 do
a[i] = (a[i] or 0) + j
end
end
-- 15.89user 0.00system 0:15.89elapsed
-- Init.
local a = {}
for i = 1, 5000 do a[i] = 0 end
for i = 1, 5000 do
for j = 1, 1000 do
a[i] = a[i] + j
end
end
-- 14.31user 0.01system 0:14.32elapsed
-- Edit luaV_tonumber:
-- lua_Number num = 0; ...
-- if ((ttisstring(obj) && luaO_str2d(svalue(obj), &num))
-- || ttisnil(obj)) { ...
local a = {}
for i = 1, 5000 do
for j = 1, 1000 do
a[i] = a[i] + j
end
end
-- 14.32user 0.00system 0:14.31elapsed
Perhaps, better is initialize...