C# vs C++ 32 bit vs 64 bit compiler performance -


i writing performance-critical program , hesitate between c# more familiar or visual c++. i've run several benchmark tests specific kind of operations need use , results puzzle me: (the reference these tests c++ win32 build)

by reference c# 32 : 50% slower, c# 64 : 4% slower

by value c# 32 : 21% slower, c# 64 : 1% faster

building x64 in visual c++ 20-30 slower building win32 same compiler options (optimized speed).

i amazed @ how 64-bit c# compiler performs compared 32-bit counterpart. why same not happen in visual c++? 64-bit compiler not optimized 64-bit?

in benchmark pass object has several imbricated structs attributes. benchmark consists of series of 50 imbricated if statements test booleans contained in structs. there no long types involved. can post code if needed, thought maybe don't know compilers.

edit: c++ win32 compiled /mt best performance. i've tried compiling x64 /md , performance 6 times slower. i remember when ran same test on similar piece of code year ago in vs2013, x64 , win32 builds performed same remember...

solved, made silly mistake of believing bool initialized false default in c++, c#...

in c++, 32-bit application has same performance 64-bit one, though both worse in c#; there bad in code!


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -