Author Topic: code completion - someone weaning himself from visual studio  (Read 4312 times)

ron8888

  • Guest
code completion - someone weaning himself from visual studio
« on: March 10, 2006, 03:49:01 am »
Hi,

I see that code completion is a WIP but I had been grown (overly?) dependent on that feature in visual studio. I have a relatively large library with lots of function overloading. Right now, my "workaround" is to refer to a doxygen doc of the library whenever I get confused (which is often the past couple of days). Does anyone have suggestions for another workaround that may be more efficient than my current method?

btw, CB is wwwwwwwwwway faster than VS for the number crunching that I am doing - probably an order of magnitude for zeroing a system of equations or solving (math) optimization problems  :D  Is there that much bloat in VS?

Ron


Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: code completion - someone weaning himself from visual studio
« Reply #1 on: March 10, 2006, 05:39:11 am »
btw, CB is wwwwwwwwwway faster than VS for the number crunching that I am doing - probably an order of magnitude for zeroing a system of equations or solving (math) optimization problems  :D  Is there that much bloat in VS?
No, the rule seems to be the other way around -- that Microsoft's compiler generally compiles faster and produces faster code than GCC (the default for Code::Blocks)*. But I'm very glad it's worked so well for you.

* This is gradually being reversed, as the VC 2005 compiler does not compile as quickly as previous Microsoft compilers. Also, The GCC 4 series is catching up quickly, sporting both faster compile times and better code optimization techniques than the 3 series.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

ron8888

  • Guest
Re: code completion - someone weaning himself from visual studio
« Reply #2 on: March 10, 2006, 06:10:09 am »
To be more specific, run-time for number-crunching (eg solving a set of nested constrained optimization problems) seems much faster in CB. Maybe I didn't set VS up properly back then. Comparing my old logs (from VS) to current ones (using CB) for the same problem and same data inputs show that the compiled CB code only takes 10 - 50 percent as much time!

Although I am pleasantly surprised, I am also quite baffled by this. Isnt the compiled code pretty much the same for gcc and VS?

I didn't compare the compile times since, in my case, they are generally neglible compared to run-time which often takes several hours.

grv575

  • Guest
Re: code completion - someone weaning himself from visual studio
« Reply #3 on: March 10, 2006, 08:21:10 am »
CB uses gcc by default under the hood.  For gcc I've had good results using -sse2 flags to replace floating point instructions with sse equivalents.  Also, -ffast-math might help, which I believe can do strength reduction.  You're probably already using -O2 since you're getting better results than you were with VC.  For VC, you probably didn't enable all the optimizaitons you could.  If you're interested, you could check which optimizations affect floating point math and what the highest optimization level is by typing:
cl /?
at a command prompt (assuming the VC bin directory is in your PATH already - vcvar32.bat should set this).

At full optimization both gcc and VC should be very comparable these days with a slight edge to VC most of the time.

takeshimiya

  • Guest
Re: code completion - someone weaning himself from visual studio
« Reply #4 on: March 10, 2006, 08:42:48 am »
Although I am pleasantly surprised, I am also quite baffled by this. Isnt the compiled code pretty much the same for gcc and VS?
Obviously not. :)

ron8888:
Code::Blocks will be always faster than VS, but that's for one thing: Code::Blocks is not a compiler, neither VS is.
C::B isn't tied to only one compiler, where the other is.

And for runtime speed, the currently most fastest compilers are GCC, MSVC, and Intel compilers. In some situations one wins, where in other situations another wins.
And since from Code::Blocks you can use all the three at the same time, you can check easily which one is faster in your case.
For numerical crunching with lot's of vectorization, tipically the Intel compiler is faster.

So if you're going to spend many hours with number crunching, it will certainly pay if you do tests and benchmarks with the three compilers and every possible runtime optimization flag.

« Last Edit: March 10, 2006, 08:46:26 am by Takeshi Miya »