Pages: 1 2 »
  Print  
Author Topic: The benefits of Visual Studio's compiler?  (Read 4507 times)
Offline (Male) time-killer-games
Posted on: September 05, 2014, 12:46:18 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1157

View Profile Email
I know we already beat GMStudio's game performance by a landslide but they are using Visual Studio for both their interpreted and YYC C++ runners. We use MinGW which is called "Min" for a reason. What would be the benefits if a dev got Visual Studio's trial and ported ENIGMA with it before the expiration date? I know no one here is willing to buy Visual Studio, and the free version (not counting the Express Edition) is for noncommercial evaluation purposes only.

Would this be a game performance boost on Windows?

Would this make game file sizes smaller on Windows?

Would it help us pave the way to making appstore-ready Windows 8 apps?
Logged
Offline (Male) edsquare
Reply #1 Posted on: September 05, 2014, 01:58:14 PM

Member
Location: The throne of ringworld
Joined: Apr 2014
Posts: 402

View Profile
Not sure about VS but you should read about mingw :

http://www.mingw.org/
Logged
A child of five would understand this. Send someone to fetch a child of five.
Groucho Marx
Offline (Unknown gender) onpon
Reply #2 Posted on: September 05, 2014, 02:29:30 PM

Member
Joined: Feb 2010
Posts: 102

View Profile WWW Email
Quote
called "Min" for a reason

Er, yeah, it's called "minimal" because it doesn't give you a full GNU environment. It gives you a minimal GNU environment within Windows, with all the important tools you would use to compile stuff on a GNU system like GNU/Linux.

I don't know how good Visual Studio's C++ compiler is, but GCC is not a performance hog by any means. There's a reason it's as popular as it is.

As far as I understand, most projects use Visual Studio instead of MinGW because it's easier to do it that way, not because it's a better compiler.
« Last Edit: September 05, 2014, 02:34:19 PM by onpon » Logged
Offline (Unknown gender) Darkstar2
Reply #3 Posted on: September 05, 2014, 02:59:15 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
Exactly - if it's EASIER you can bet your last buck that YYG will use it.

I don't think the compiler itself is holding ENIGMA back, it's the code.
In theory ENIGMA engine could be re-written, removing ties with GM compatibility and could be way smaller and way faster than it currently is.  So you won't get any significant speed increase or size decrease from using another compiler.  ENIGMA makes fairly small files, it is native C++, the smallest file size I could make using ENIGMA is 320k-340k, basically the dependencies are linked in the final EXE.  Even a C++ code can take several K size EXE if you are using certain libraries.  ENIGMA produces smaller files than YYC that's for sure.
If Studio is faster in some areas it's not because of their compiler !
YYG includes symbols in its compile right ?  From what I recall ENIGMA does not do that, right ? Wrong ? which is a good thing in a way.
Logged
Offline (Unknown gender) daz
Reply #4 Posted on: September 05, 2014, 07:06:57 PM
Contributor
Joined: Jul 2010
Posts: 167

View Profile
As C++ code grows in complexity the binary size is almost exponential. It gets especially big once you start linking in other libraries. It's not something that can really be avoided (bar not using 3rd party libraries or switching languages) but it's not a big deal at this point. Even if the final executable is 25mb for a large game, the rest of your game's content will likely dwarf that.

I don't know why you'd want to use VS's compiler on Windows, especially since MinGW is already working just fine. I mean I guess if someone's bored try to get it compiling and let us know the performance differences, but it'll likely be trivial.
Logged
Offline (Unknown gender) Darkstar2
Reply #5 Posted on: September 05, 2014, 07:29:18 PM
Member
Joined: Jan 2014
Posts: 1244

View Profile Email
In my opinion files would be bigger. And any performance would be trivial.
the main issue with performance is not the compiler.

I'm sure GMS could further use code optimising and performance increase.
All I know is that the YYC is hype and was not all that it is claimed to be and from my own tests with someone's game source/game (with their permission) I could make much smaller sizes in ENIGMA, and performance was better.

Logged
Offline (Male) Rusky
Reply #6 Posted on: September 05, 2014, 08:30:42 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Darkstar2, why are you qualified to have an opinion on the effect of using VC++ over GCC? Have you run any tests? Just googling that, I see both compilers beating each other in different situations, with much wider variation just from the optimization flags used than from the compiler. MSVC and GCC are both high-quality compilers, and MinGW is just a Windows port of GCC- it's exactly the same program.

The biggest reason by far to use Visual Studio and/or its compiler on Windows is library and tool support. Visual Studio is a fantastic IDE with a fantastic debugger; all Windows SDKs are supported primarily (and often only) on MSVC; MSVC is guaranteed to be compatible with Windows. For example, rc files on Windows are a huge pain point in ENIGMA's build process because MinGW's windres.exe is perpetually broken. Further, Visual Studio's Express Edition has no restrictions on what you use it for. The only restrictions are some of the more advanced features that would be almost useless in porting ENIGMA.

Games probably wouldn't change noticeably by switching compilers. Some would maybe gain, some would maybe lose, there might be some rare pathological cases where one or the other compiler is way slower or faster. You can develop Windows App Store games with MinGW anyway, so it wouldn't make a difference there either.
Logged
Offline (Male) time-killer-games
Reply #7 Posted on: September 05, 2014, 09:17:51 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1157

View Profile Email
Thank you Rusky that was the perfect answer! You seem to know exactly what your talking about and I respect that. This was just asked out of curiosity. If porting to Visual Studio doesn't help anything, then I guess it's not a major concern, which is good, you guys have enough on your plate.

Thank you! :D
Logged
Offline (Male) DaSpirit
Reply #8 Posted on: September 06, 2014, 11:00:12 AM

Member
Location: New York City
Joined: Mar 2013
Posts: 124

View Profile
I prefer MinGW on Windows because if you compile an application with Visual Studio, then your user must also download the Visual Studio Redistribution libraries for the matching Visual Studio version. Windows does come with pre-installed versions of the redistributable packages, but whenever a new Visual Studio version comes out, then all of a sudden your users will have to download the redistribution package themselves. For MinGW, you only have to include the MinGW dll with your executable, which is also forwards compatible (to some extent).

Previously, another reason I preferred MinGW was because they added C++11 support faster. Microsoft does not support their C++ compilers as much as they should be, and are a little slow at adding new features. As of now, VS2014 does not support unicode string literals, binary literals or generic lambdas, all features that I have been using in MinGW for years and would mean that I have to remove those features to compile in VS. ENIGMA itself wouldn't have this issue, because it uses C++0x, but it could always be an issue down the line when ENIGMA adds support for newer compilers.

I find Visual Studio better than MinGW in terms of proper debugging support. Namely, most tools for detecting memory leaks were made for Visual Studio. Also the Visual Studio IDE is a very polished IDE. Although, you could always theoretically just use valgrind in Linux by compiling in GCC (like I do).
Logged
Offline (Male) time-killer-games
Reply #9 Posted on: September 06, 2014, 11:22:40 AM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1157

View Profile Email
Where did you come from DaSpirit? We missed you! :D Thanks for the info, sounds like because of less forwards compatibility it was a great move to not use VS. GCC is perfect. I'm glad we're using arguably the best compiler for the job, really encouraging.
Logged
Offline (Unknown gender) TheExDeus
Reply #10 Posted on: September 07, 2014, 08:30:11 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
I also personally don't like VS. It's very bloated, so ENIGMA would weight A LOT more if used. There could potentially be many more dependencies as well, as is the case with a lot of VS made programs. Like you have to install 300mb dependency (what MS calls "Redistributable Packages") to run 2mb large math example program. In this case MinGW is a lot better, as it can make standalone executable very small. And as DaSpirit pointed out, VS is very slow at C++ standards. It took them years to implement many C++11 features, and they still don't support many of them (check http://cpprocks.com/c1114-compiler-and-library-shootout/). MS has historically been VERY slow to adopt standards, which is why IE couldn't render any webpage properly for decades. GCC on the other hand implements the standards rapidly, which often include optimizations as well, so it's generally faster. VS can't compile anything outside Windows as well, so we would still use MinGW, which end up us maintaining several different systems again. So long story short, using VS would be a mistake. The only good thing is debugging, but there are many alternative ways we could improve that as well.

I would actually have a discussion about using C++11/14 features in ENIGMA source as well. I think we should start doing that and thus get rid of some nastiness we had to do before. I think some guy who did changes to math.h/cpp already used some new C++ there.
« Last Edit: September 07, 2014, 08:33:27 AM by TheExDeus » Logged
Offline (Male) Josh @ Dreamland
Reply #11 Posted on: September 07, 2014, 09:52:25 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
That's not a reason to not support it. The reason to not support it is that no developers own it, or even the express version, for those reasons.

That said, the vast majority of ENIGMA -should- compile with Visual Studio. We -are- using GNU extensions in places, but the ones we use are largely going to be included in C++14 or are already supported by virtually all compilers.

How easy is it to set up ENIGMA's other basic dependencies in VS? It might be the dumb answer to all our dumb questions.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Rusky
Reply #12 Posted on: September 07, 2014, 10:10:51 AM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Where are you getting the idea that VS outputs bloated executables? GCC also requires a separate standard library, unless (in both VS and GCC) you statically link it. Visual Studio's is about 6Mb, which is actually around the same size as what GCC adds when you statically link. However, it's installed by default on newer Windows installs, so you can use an older version and not depend on anything.

I'm not advocating either compiler in particular, but the reasons you're citing against VS are not all true. VS on Windows works much more smoothly and integrates better than MinGW- there's a reason people use it there.
Logged
Offline (Unknown gender) TheExDeus
Reply #13 Posted on: September 07, 2014, 12:02:55 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Quote
That's not a reason to not support it.
The reason not to support it is because there is no reason to support it.

Quote
there's a reason people use it there.
Mostly for the IDE. We actually have used VS IDE together with VisualGDB to write code for RaspberryPi. So we use GCC to compile, but use VS just for the IDE. Most people who use VS outside of IDE are people who write C#, which are people who doesn't have any real alternative.

I have worked on projects that use VS with C++, C# and so .NET as well. And from my experience it's almost impossible to run a compiled executable without installing A LOT of dependencies before hand. In C++ case it's better of course than in .NET/C# case where you seriously must install sometimes hundreds of MB of dependencies. Of course MS keep adding to dependencies in newer versions of windows as well, but whenever you use a newer VS in an older windows (like Win7) you end up with this bloat problem. MinGW is the only compile I know which actually outputs windows executable with NO dependencies (when statically linked). In VS case you even have to install bloat just to run VS itself. That is why we run VS in a virtual machine, so we can just delete the machine together with all the bloat when the project ends and we have to install another version of VS for a newer one. Now we are actually just developing on Linux and compiling the same code on Windows using MinGW and cross-compiling. It's just easier that way.
Logged
Offline (Male) Goombert
Reply #14 Posted on: September 07, 2014, 12:53:22 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3107

View Profile
Harri raises an interesting question. I do not think .NET is backwards compatible, correct me if I am wrong but I believe the framework is designed with forward compatibility in mind. Evidence for this is that I currently have over 10 different MSVC redistributables installed, I didn't install them they were factory default. This directly contrasts with the JSE which is almost always backwards compatible, the only thing I ever ran into that was deprecated was thread.stop();

Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1 2 »
  Print