pouët.net

Sizecoding with newer Visual Studio versions?

category: code [glöplog]
 
Something I've been meaning to ask for a while...

Are there any decent resources there with which options to use and what libs to exclude when developing using newer Visual Studio versions? At home, I'm currently using the free Visual Studio Community 2015.

I'm not quite asking about getting down to '4K' sizes, but as a starting point putting the bloated standard exe's on a diet would be useful!

I don't mind if this goes off down the crinkler route, but I assume getting the size down first is also important.
added on the 2016-01-26 13:30:01 by Canopy Canopy
I am using VSCE2013 and i could use my old setting from VS2008...i think you should be safe to use the same settings in VSCE2015.
Resource-wise i can only advise you to have a look into the project-settings of IQs 4k/64k-VS-Solutions here for 4Ks or from here for other sizes/languages.
Ah yes, I had come across those a while back.

Thanks, for ve confirming that the VS2008 methods work in VS2013 it's, as you say, likely the same things will work with VS2015.

The Free Community Ed. isn't really limited over the Pro version I use at work, just easier licensing wise.

I'll have to try the compiiler/project options from IQ's examples, with my framework and see which have a good impact.

Any other resources out there would be appreciated.
added on the 2016-01-26 18:31:40 by Canopy Canopy
Source code for Molten Core 1k intro http://www.pouet.net/prod.php?which=64235
added on the 2016-01-26 21:21:16 by yzi yzi
That might not be the best example Yzi if he is wondering about C/C++ compilation settings and libraries. But if you want to see how to run a basic openGL shader on windows in shitty assembly code in a small size then feel free to take a look.

I agree with what Hardy said, I learned what a minimal demo framework looks like from the IQ examples. Naturally you want to use those as a starting point and learn, experiment and improve on those. Also like Hardy said the new VS versions are great at importing and updating older version solutions.

With the compiler settings you can start with settings used in the IQ examples, then there are some settings you may want to learn and experiment with. Certain settings can have a size decrease OR increase, depending on your code. Things like intrinsics, inlining and actually the whole program optimisation can have a surprising change in size either positive or negative depending on your code. Best is to learn what the settings do from the MSDN docs or a more naive way is to recompile your code with each setting turned on or off and observe the differences.

Libraries you want to get rid of as many as possible. Try to use only the bare minimum system libs. Personally I avoid all 3rd party libs and roll my own, I also avoid all standard template libraries. It is surprising how much you can save by replacing std::string or std::vector with your own minimal implementations. While the STL stuff is convenient and easy to use it is often overkill for small demos/intros where you know exactly what data you are using, how big it is and what you want to do with it.

The other thing I can think of is coding style. For most demosceners who grew up with and learned to code on 1980's hardware the mindset of minimal and low level coding comes naturally. If you code in a more modern style the emphasis is on writing code as easily and quickly as possible (using lot's of libraries), making code flexible, catering to many use cases, robust, readable and maintainable, OO and all that stuff. When it comes to democoding and sizecoding you want to only ever do the minimal amount of code to get the end result for a specific case.

There is also 1k and 4k code discussion threads on the pouet bbs if you search for them, they have some good tips.
added on the 2016-01-26 22:05:20 by drift drift

login