Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8434401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:38:42+00:00 2026-06-10T06:38:42+00:00

I have a program very basic with just functions and variables and performs some

  • 0

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);
   }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T06:38:43+00:00Added an answer on June 10, 2026 at 6:38 am

    The only reliable way to find out where your program is spending all that time is to profile it. That would show you the time spent in each method/function and you should be able to track down the delay. If you cannot use a profiler for some reason, you might just try inserting a few timing calls in critical stages of your code to isolate the location of the problem.

    That said, my guess would be on the I/O part of your program (cout, printf …). The calculations should compile to similar code on both architectures and, unless your are using external libraries, they should not be affected by the porting process. The I/O calls, on the other hand, could be affected by differences in the standard library and in how each OS handles buffering and I/O in general. Conceivably, there might also be some library function that is not well implemented on Windows.

    An important piece of information would be how your program is behaving during those 160+ seconds. Is it burning the CPU at 100%, or is it idling waiting for something to happen?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic program in C++ compiled in VS 11 Beta on
I have a very basic program which displays a standard Textview and a extended
I have a program in C using Solaris with VERY ancient compatibility it seems.
I have a very simple question. I have a program that accepts an integer
I have a problem with debugging sessions. My program executes very well in a
I have a very large program which I have been compiling under visual studio
I have a very small program: public static void main(String[] args) { Queue<String> queue
It's a very simple program. I have a function defined on the top and
I have a very simple test program, running on Solaris 5.8: #include <stdio.h> #include
I have a GLSL shader program running my iPhone app (it's a very very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.