I have a program very basic with just functions and variables and performs some calculations. The build part is fine. there is only cout, adding, multiplying etc very elementary stuff.
On linux, program runs fine on eclipse cdt, (runs in about 3-4 seconds)
When the program runs on windows 7 on visual studio 2010 c++, took 163 seconds when the program runs on windows 7 eclipse c++ with MinGW, alot
What is going on here??!!?!
EDIT: lets not call it c++, its just alot of C functions here, here is the code from the main()
foutput1 = fopen(FILENAME1, "w");
foutput2 = fopen(FILENAME2, "w");
solveSystem();
OutputStepToFile();
iter++;
do
{
temporalExternalChange(tim);
do
{
solveSystem();
iter++;
} while (iter<T_FOUT);
iter = 0;
OutputStepToFile();
tim+=dt*T_FOUT;
if (fmod(tim,T_PRINT)<=0.0){cout << "\nt=" << tim << "ms";};
} while(tim<T_TOTAL);
SolveSystem() is the following (partial) which just functions that do calculations to some variables:
void solveSystem()
{
fsGCcGMPformation(); // !cGMP formation
falp1AdAct_IP3form(); // !Norepinephrine receptor
fIVoCC(); // !Voltage dependent calcium current I_CaL
fIKv(); // !Delayed rectifier current I_K
fIBKCa(); // !Calcium-activated potassium
...
...
...
fVoltageChange();
performODEstep();
}
OutputStepToFile() function is simply using C style file output
void OutputStepToFile()
{
fprintf(foutput1,"%g %g %g %g %g %g %g %g ",V_m, tim, Ca_i, Na_i, K_i, Cl_i, Ca_u, Ca_r); // 1
fprintf(foutput1,"%g %g %g %g %g %g %g ",d_L, f_L, BKCa_a, KvD_a, KvD_i_slow, KvD_i_fast, KCNQ_a); // 8
fprintf(foutput1,"%g %g %g %g ",P_SOC, R_01, R_10, R_11); // 15
fprintf(foutput1,"%g %g %g %g %g %g %g %g %g\n", h_IP3, RS_G, RS_PG, G, IP3, PIP2, DAG, V_cGMP, cGMP); // 22
// Store Ca,K,Cl,Na ion channels
fprintf(foutput2,"%g %g %g %g %g %g %g %g %g ", I_CaL, I_CaT, I_BKCa, I_KvD, I_KCNQ, I_K2P, I_Kir, I_KATP, I_CaCC);
// Store ROCs/SOCs
fprintf(foutput2,"%g %g %g %g %g %g %g ", INa_NSC, IK_NSC, ICa_NSC, I_NSC, I_SOCNa, I_SOCCa, I_SOC);
// store SR dynamic currents, co-transporters, pumps and exchangers
fprintf(foutput2,"%g %g %g %g %g %g %g %g ", I_up, I_tr, I_rel, I_IP3, I_PMCA, I_NaK, I_NCX, I_NaKCl_Cl);
fprintf(foutput2,"%g %g %g %g %g %g\n", I_stim, V_cGMPbar, I_Catotm, I_Natotm, I_Cltotm, I_Ktotm);
}