Dear Gauss people,
My colleague and I have different intuition about what is the best way of coding some big calculations. That is, we need both to conserve memory requirements and we need to reduce computing times. Here are three alternatives:
1) Step by step:
a=(big calculation);
b=(another big calculation);
c=(big calculation involving a and b);
2) Reusing b/c space:
a=(big calculation);
c=(another big calculation);
c=(big calculation involving a and b);
3) Let the compiler choose:
c=(big calculation involving (big calculation) and (another big calculation));
Is it possible to say which is generally better? Maybe depends on how big is big?
Thank you,
Tue
1 Answer
0
Option #1 will never be the fastest because GAUSS will not have the option to reuse the memory used for a
and b
when creating c
.
In most cases, #3 will be the fastest. However, if the data size is large compared to your available RAM and the particular big calculation requires lots of extra memory to be allocated for intermediate calculations, then #3 could be slower.
Your Answer
1 Answer
Option #1 will never be the fastest because GAUSS will not have the option to reuse the memory used for a
and b
when creating c
.
In most cases, #3 will be the fastest. However, if the data size is large compared to your available RAM and the particular big calculation requires lots of extra memory to be allocated for intermediate calculations, then #3 could be slower.