Euphoria bug

new topic     » topic index » view thread      » older message » newer message

--I've been getting a lot of misleading results during benchmarking
--of various large structures which prompted an investigation.
--The following example shows an anomaly I found.
--Run the programme with and without releasing the commented loop(s)
--and note the speed of the loops. 1D structures are fast and behave normally.

sequence s
atom t
object data
constant repeats = 1000000, len = 1000

s = repeat(repeat({}, len), len)

-- --this loop always appears to be fast and speeds up all following loops
-- t = time()
-- for n = 1 to repeats do
-- s[length(s)][length(s)] =  {3333, 7777}
-- data = s[length(s)][length(s)]
-- end for
-- ?time()-t

-- t = time()
-- for n = 1 to repeats do
-- s[999][999] =  {3333, 7777}
-- data = s[999][999]
-- end for
-- ?time()-t

t = time()--identical to the second loop
for n = 1 to repeats do
s[999][999] =  {3333, 7777}
data = s[999][999]
end for
?time()-t

machine_proc(26,0)

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu