Re: Dramatic slowdown -ping Rob

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

Pete Lomax wrote:
> 
> I've narrowed down the unexpected performance hit I mentioned earlier
> today (Re: Contest Update (12-Nov-2004))
> 
> If INNER is 27, this completes in 0.27 seconds. If it is 28, it takes
> 3.19 seconds, over tenfold performance drop. Why?
> 
> Does anyone else get these results? You may need to massage the
> figures a little to account for memory/cpu differences.
> 
> Rob, if you manage to duplicate this performance hit on 2.4, do you
> get the same on 2.5?
> 
> }}}
<eucode>
> constant START = time()
> constant INNER=28
> sequence table
> 		table=repeat(repeat(0,INNER),1024)
> integer used
> 		used=1
> 
> for i=1 to 45000 do
> 	used+=1
> 	if used>length(table) then table&=repeat(repeat(0,INNER),1024) end
> if
> 	table[used][5]=used
> end for
> 
> printf(1, "Elapsed time: %f\n", time() - START)
> </eucode>
{{{

> 
> Regards,
> Pete
> PS the performance hit disappears if I initialise the table to 40,000
> entries

On my 1.8 GHz Pentium-4 machine with 256 Mb RAM,
running ex.exe:

Euphoria 2.4  27  0.94
              28  1.70

Euphoria 2.5  27  0.05
              28  0.05

I couldn't believe this, so I dumped "table" into a file
and did a diff. There was no difference. The times
seemed reasonable. With 2.5 the prompt came back instantly.
With 2.4 it took a second or so.

I can't really explain this, other than to point out that
sometimes weird performance situations can develop with 
the malloc() heap. 2.5 frees up a lot of front-end data 
before running the back-end, but that couldn't explain everything.
Maybe I put in an optimization that I've forgotten about.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu