Jump to content
  • Advertisement
Sign in to follow this  
Boder

Getting the Best of the Microsoft Compiler

This topic is 4715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't get the compiler to perform as well as the people who compiled the tutorial samples for a library I'm looking at. You can see the difference in size, and I want to understand how I can get the compiler to perform as well before I move on. THEM: 35,840 B ME: 55,808 B Here are the options I am using for the commands: cl -c -nologo -G7 -O2 link /MACHINE:X86 strip -s

Share this post


Link to post
Share on other sites
Advertisement
It's the optimizing compiler they released in the toolkit from 2003.

Quote:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3052 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.


The only library I'm linking to, besides the engine, is user32.lib and I just checked that they had to link to it because it uses a MessageBox.

Maybe I'm linking to libc and they are linking with MSCRT?

Share this post


Link to post
Share on other sites
I can't find MSVCRT.lib anywhere, I checked the Platform SDK and the compiler lib/ folder. This might be it.

Is there an "ldd" equivalent for Windows so I can see what it's linked to?

Share this post


Link to post
Share on other sites
Quote:
Original post by Boder
I can't get the compiler to perform as well as the people who compiled the tutorial samples for a library I'm looking at. You can see the difference in size, and I want to understand how I can get the compiler to perform as well before I move on.

THEM: 35,840 B
ME: 55,808 B

Here are the options I am using for the commands:

cl -c -nologo -G7 -O2
link /MACHINE:X86
strip -s


Make sure that you are targeting the same version of the standard lib - by default it statically links it in, but you can link to the dll(which will make your exe smaller).

Share this post


Link to post
Share on other sites
I got dependency walker.

ME:
Image hosted by TinyPic.com

THEM:
Image hosted by TinyPic.com


Size of compiler lib/ file = 19.9 MB
I'm going to look into linking with the dll.

Share this post


Link to post
Share on other sites
How about frame pointer emission?

I tried global optimizations and it didn't help.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!