Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / June 2007

Tip: Looking for answers? Try searching our database.

How to speed up C++/CLI build process?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
hesicong - 16 Jun 2007 07:03 GMT
I notice that compiling older C++ program with /clr option needs a lot
of time. Now I have a program below which use mix code feature in C++/CLI:
#include "stdafx.h"
#include "ManagedException.h"
class MixClass
{
  ....(500 lines MixCode Here)
}
stdafx.h includes many stable header files. MixCode here has 500 lines.
If I change just 1 line in the MixCode, I have to wait a few seconds to
compile it again.
So I want to know if there is some way to speed up this build process?
Thanks!
Ben Voigt [C++ MVP] - 16 Jun 2007 18:48 GMT
>I notice that compiling older C++ program with /clr option needs a lot of
>time. Now I have a program below which use mix code feature in C++/CLI:
[quoted text clipped - 9 lines]
> So I want to know if there is some way to speed up this build process?
> Thanks!

Are you using precompiled headers?

And a class with 500 members seems badly oversized.  Perhaps you have
function definitions placed inline, java-style, that should be moved to a
separate .cpp file.
Rick C - 22 Jun 2007 21:36 GMT
>>I notice that compiling older C++ program with /clr option needs a lot of
>>time. Now I have a program below which use mix code feature in C++/CLI:
[quoted text clipped - 15 lines]
> function definitions placed inline, java-style, that should be moved to a
> separate .cpp file.

Ben, he said lines, not members.
Ben Voigt [C++ MVP] - 22 Jun 2007 21:45 GMT
>>>I notice that compiling older C++ program with /clr option needs a lot of
>>>time. Now I have a program below which use mix code feature in C++/CLI:
[quoted text clipped - 17 lines]
>
> Ben, he said lines, not members.

C++ class definitions should have (not counting blanks and comments) one
line per member.

Any function body too long to fit on a single line should be defined outside
the class definition.  Failing to do this will affect build time, which was
the original complaint.  It also causes changes to cause the compiler to
reprocess code that wasn't affected.  The only reason to recompile all code
using the header is if the public interface changed.  Implementation changes
should only require recompiling the matching .cpp file, not users.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.