Getting the Best of the Microsoft Compiler

Started by
6 comments, last by Boder 18 years, 9 months ago
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
Advertisement
You make it sound like there's only one Microsoft Compiler.

Version?
You're probably linking to a default library which they omitted.
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?
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?
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).
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.
How about frame pointer emission?

I tried global optimizations and it didn't help.

This topic is closed to new replies.

Advertisement