T
trouble
Hi,
I have a program that needs to reserve about 1 to 10 Mb of memory
every time it's run. Only one instance of the program is run at any
given time but it's called about 100 times in succession. Speed is
pretty important.
What are the pros and cons of:
(a) hard coding in a large array into the program, as in float
arr[100000000];
(b) dynamically allocating the array as necessary
I'd prefer (b) for aesthetic reasons but will follow the bottom line
(speed!). G
Given that the data processing on each call will take a couple of
seconds, is malloc / new likely to be a bottleneck?
Thanks,
Ciao.
I have a program that needs to reserve about 1 to 10 Mb of memory
every time it's run. Only one instance of the program is run at any
given time but it's called about 100 times in succession. Speed is
pretty important.
What are the pros and cons of:
(a) hard coding in a large array into the program, as in float
arr[100000000];
(b) dynamically allocating the array as necessary
I'd prefer (b) for aesthetic reasons but will follow the bottom line
(speed!). G
Given that the data processing on each call will take a couple of
seconds, is malloc / new likely to be a bottleneck?
Thanks,
Ciao.