On Wed, 27 Jan 2016 14:00:34 +0000, Stephen Wolstenholme
Post by Stephen WolstenholmePost by JiiPeePost by GeoffPost by JiiPeePost by GeoffPost by JiiPeeIf I start a new project, it gives by default 32 bit project. I can
change it from the combobox after, but how can I get so that all project
are by default 64 bit projects, x64?
Close all instances of Visual Studio.
Explore Visual Studio folder under "Program Files (x86)"
Make a backup copy of VC\VCWizards\default.vcxproj
VC\VCWizards\default.vcxproj
Change all "Win32" to "x64"
Now all your new projects will be x64.
All... but does that prevent using Win32 (86) then? I would like to have
both there (in the selection combobox) but x64 as a first choice and
default for projects. I do not want to totally delete Win32/86
No, you'll have an x64 platform from which you can later create a
Win32 platform target. This is exactly the converse of starting with
Win32 and creating an x64 with the configuration manager.
oh ok, so after that I have to just add Win32 manually and it becomes
the second choice.
To be honest, imo this should be a tick in the settings to easily select
the default type.
I set things up to create x64 applications. After resolving all the
pointer warnings and timer errors I got it to build. I then discovered
that most of my users could not run it. The ones that could found it
was slower than the 32 bit version. I decided to revert to Win32 for
another few years.
Steve
I suppose there are all kinds of architectural reasons why an x64 app
might be slower than the same code targeted to Win32. Just memory
access for a 64 bit pointer on a 32-bit optimized motherboard would
slow the thing down and if the upper 32 bits of that pointer are
unused, it's wasted bus cycles.
Advantages
Use and access more then 2GiB of virtual memory
Access to more CPU registers (but this is transparent in compiled
code) the compiler might have more freedom to optimize.
Systems running your application should support SSE2 (and something
like 99.89% support also SSE3)
SSE2 automatic optimizations by visual studio.
Disadvantages
Some legacy 3rd party libraries simply don't support x64
Pointers are 64 bit length instead of 32 (more memory needed and
potential issues with bad coding, for example, storing pointer values
into integers or vice versa)
Portability issues (LLP64 vs LP64)
Not providing a 32-bit build, you restrict your user base but this is
less of an issue these days as more users upgrade their hardware.
When migrating from Win32 to x64 you should have good reasons to do
so, the need for larger objects or memory space for your data being
primary, if you're only using 2GB at a time you don't need the extra
cycles. If the system itself chokes with swapping because it can't
support your heavy resource usage, you impaired your application.
Measure and test, prove the change was worth it. Specify the minimum
platform requirements for the x64 version vs the Win32.