Re: Euphoria bug
- Posted by Vincent <darkvincentdude at yahoo.com> Sep 13, 2005
- 552 views
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