Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
GeneralRe: api Pin
Christian Graus16-Oct-03 10:07
protectorChristian Graus16-Oct-03 10:07 
Generallistview Pin
jphuphilly15-Oct-03 13:39
jphuphilly15-Oct-03 13:39 
GeneralRe: listview Pin
Heath Stewart16-Oct-03 9:23
protectorHeath Stewart16-Oct-03 9:23 
Generalc++ vs C# Pin
totig15-Oct-03 11:30
totig15-Oct-03 11:30 
GeneralRe: c++ vs C# Pin
Christian Graus15-Oct-03 13:48
protectorChristian Graus15-Oct-03 13:48 
GeneralRe: c++ vs C# Pin
leppie16-Oct-03 8:24
leppie16-Oct-03 8:24 
GeneralRe: c++ vs C# Pin
Christian Graus16-Oct-03 10:04
protectorChristian Graus16-Oct-03 10:04 
GeneralRe: c++ vs C# Pin
Eric Gunnerson (msft)16-Oct-03 10:33
Eric Gunnerson (msft)16-Oct-03 10:33 
There are a number of reasons why C# compiles faster than C++. Here are the ones I thought of - there are likely more.

1) No preprocessor. In C++, you either need a separate preprocessor step or a fairly complex on-the-fly preprocessor (I don't remember offhand what VC++ does). In C#, you can easily do everything on the fly.

2) "All at once" compile model. In C#, all the compilands are compiled at once, and in C++, one file at a time, plus link time at the end.

3) Much easier metadata model. The #include model of C++ doesn't scale particularly well, and it requires reading the include files in textual format (including the preprocessor step) for every compilation. Compilers can get around this with "precompiled headers", which helps get rid of some of the overhead, but at the expense of more complexity when the set of includes changes. It also only applies to system headers, not ones from the current project. C# gets the ability to read in metadata in a binary format and more importantly, on a per-assembly basis. This is roughly the difference between looking for data in a database and looking through a text file to find the data.

4) Smaller set of libraries to consider. The Win32 Platform SDK is a huge beast, and typically has gotten bigger with each release. On the C++ team, it was not uncommon for us to work hard to get 10-20% increase in compile speed, only to see all of that eaten up by the increase in size of the windows headers.

4) Very limited compiler optimization. The C++ optimizer on release builds will normally take more time on a per-file basis than the parsing phase, though I will point out that even if you build a debug, non-optized build, C# is still quite a bit faster.

Eric Gunnerson
Current C# Compiler Program Manager
Past Visual C# Compiler QA Lead
Past Visual C++ Compiler QA Lead
Generalenums suck! Pin
Alvaro Mendez15-Oct-03 9:17
Alvaro Mendez15-Oct-03 9:17 
GeneralRe: enums suck! Pin
Richard Lowe15-Oct-03 10:36
Richard Lowe15-Oct-03 10:36 
GeneralRe: enums suck! Pin
Alvaro Mendez15-Oct-03 11:10
Alvaro Mendez15-Oct-03 11:10 
GeneralRe: enums suck! Pin
Heath Stewart15-Oct-03 11:52
protectorHeath Stewart15-Oct-03 11:52 
GeneralRe: enums suck! Pin
Alvaro Mendez15-Oct-03 13:04
Alvaro Mendez15-Oct-03 13:04 
GeneralRe: enums suck! Pin
bjoernen16-Oct-03 3:36
bjoernen16-Oct-03 3:36 
GeneralRe: enums suck! Pin
Richard Lowe16-Oct-03 3:37
Richard Lowe16-Oct-03 3:37 
GeneralToolbar Pin
Gary Kirkham15-Oct-03 8:50
Gary Kirkham15-Oct-03 8:50 
GeneralRe: Toolbar Pin
Heath Stewart15-Oct-03 11:54
protectorHeath Stewart15-Oct-03 11:54 
GeneralCustom Controls and Enum value Types Pin
Douglas Troy15-Oct-03 5:45
Douglas Troy15-Oct-03 5:45 
GeneralPassing a Form reference to a new Form Pin
mikemilano15-Oct-03 4:50
mikemilano15-Oct-03 4:50 
GeneralRe: Passing a Form reference to a new Form Pin
Mike Dimmick15-Oct-03 4:59
Mike Dimmick15-Oct-03 4:59 
GeneralBindingContext Pin
Anonymous15-Oct-03 4:45
Anonymous15-Oct-03 4:45 
GeneralWindows Form TabPage Pin
Jubal15-Oct-03 4:19
Jubal15-Oct-03 4:19 
GeneralRe: Windows Form TabPage Pin
Wjousts15-Oct-03 5:49
Wjousts15-Oct-03 5:49 
GeneralUsing C# in MFC Project Pin
Anonymous14-Oct-03 23:53
Anonymous14-Oct-03 23:53 
GeneralVersioning Solution Pin
Member 37818914-Oct-03 20:55
Member 37818914-Oct-03 20:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.