Re: Euphoria bug

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

Bob Thompson wrote:
> 
> --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)
> 

Excellent find! The bug is in Euphoria v2.4 as well. It took 1 second to execute
the first 2 blocks, but when I commented them out, it took 10 seconds to execute
the last block.

Regards,
Vincent

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

Search



Quick Links

User menu

Not signed in.

Misc Menu