How can I reduce compilation time on my ATL COM objects?

Hi, John. I am now working on a COM project having roughly 600 ATL COM objects. All these are there in a single...

COM project. Now the file with COM object entries (the main project.cpp file) takes around 12 minutes on my dual CPU 1GB RAM machine. If I comment out the object entry lines between

// my com object entries here

it just takes under a minute to compile. Is there any particular reason for this behavior? How can I reduce the compilation time? I am using precompiled headers in my project.

Those fancy ATL macros expand into a ton of code, that's why it takes so long. When it comes to compiling speed, CPUs and memory have nothing to do with it. The magic is all in the hard disk and the bottleneck of the really poor bus speeds we have to deal with on PC machines. If all of your object MAPs are in the same file, your PROJECT.CPP, you might want to move them to separate files. While no compile should take that long, having 600 ATL COM objects in a project seems excessive to me. I've seen some huge applications and the most they had was about 100.
This was first published in April 2002

Dig Deeper



Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:









  • Virtual desktop security guide

    To secure virtual desktops, consider antivirus, certificates and network vulnerabilities. Just remember, VDI doesn't always ...

  • Guide to low-cost desktop virtualization

    In this guide, learn to virtualize desktops without spending more than you would when deploying PCs, and what VDI vendors are ...

  • VDI pilot project guide

    A VDI pilot project should start with a VDI project plan. Know what pitfalls to avoid and test product options to achieve a ...