can someone explain why...
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: can someone explain why...
- From: Thierry <th.douez@...>
- Date: Tue, 5 Oct 2010 11:14:51 +0200
Hi,
Learning Lua, I'm a bit puzzled with this test :
Could someone explain why the first script below is about 10%
faster than the second ?
Intuitively, I would have guessed the opposite.
Thanks
Thierry
for y = y0 , y1 do
for x = x0, x1 do
local v = get_value(x,y)
local r,g,b = get_rgb(x,y)
<....../>
end
end
local v, r,g,b
for y = y0 , y1 do
for x = x0, x1 do
v = get_value(x,y)
r,g,b = get_rgb(x,y)
<....../>
end
end