Hi,

I have an Inline::C script that's rather intensive on memory usage. The
inline C function takes 4.05 seconds to run.

Realising that I had initialised a C array to be twice as large as
necessary, I halved it's size, which chopped 250 milliseconds off the
running time.

Then I realised that there was a second array that could likewise be
halved - but when I did that, the running time increased back to 4.05
seconds.

In short, I can save 250 milliseconds by halving the size of one (and only
one) of the two C arrays - and it doesn't matter which array I shorten. But
if I shorten *both* arrays, I get no saving in execution time. Doesn't make
sense to me.

Anyone have any enlightening remarks upon what's likely to be happening ?

All I'm doing is changing the initialisation:
int d[ARR] = {0};
to
int d[ARR / 2] = {0};
where ARR = 2500.
2500 is also larger than necessary, and I've found that I can also *slow*
the execution speed by reducing it to 2000 :-)

Cheers,
Rob

Reply via email to