Recently moved from python to C#. Developing math app. Looked through many questions at SO about class vs struct, so I would like an advice from experienced people regarding performance.
DETAILS
I have a method, and during its execution 6 double variables are calculated and about 6 double[] arrays of same lenght. I want my method to return all them "packed" into one variable. Not planning to change them, I just need a storage and acces to them. During execution of the app, method will be called many times, such storages will be created many times also (up to 40).
REPRODUCING EXAMPLE
public (???) Method (params)
{
double return_value1 = actions_with_params1;
double return_value2 = actions_with_params2;
double[] return_array1 = actions_with_paramsin_a_loop1;
double[] return_array2 = actions_with_paramsin_a_loop2;
}
... and so on. I want to return a variable holding both double
s and double[]
s. What should I use better insetafd of (???)
? Class or struct, regarding performance?
Thank you!