Speeding up Visual C++ Qt Builds

March 27, 2009 by Jörg Bornemann As a developer of Visual C++, you're likely all too familiar with the frustration of watching your CPU usage skyrocket as your project compiles. The sight of the task manager displaying a distressing 25% CPU usage can be enough to keep even the most seasoned programmer up at night. But fear not, dear Visual C++ developer! For months, a new generation of developers has been hacking away on their quad-core machines, effortlessly compiling Qt using GNU make and enjoying the fruits of their labor while you're still sipping your morning coffee.

The secret to their success lies in an innovative approach to the build process. By leveraging multiple processing cores simultaneously, these open-source enthusiasts have managed to significantly speed up the compilation process. And now, thanks to Jörg Bornemann's ingenious nmake clone, dubbed "jom", Visual C++ developers can join the ranks of the productivity elite.

Jom is a powerful tool that utilizes an arbitrary number of processes concurrently, maximizing CPU utilization and minimizing build times. This revolutionary approach has already been tested on a quad-core machine with remarkable results: build times are reduced by half compared to traditional nmake!

So, how does jom achieve this impressive feat? Simply put, it's all about efficiency. Jom automatically detects the number of processor cores available in your system using QThread::idealThreadCount(). This ensures that the build process can harness the full potential of your hardware.

But what about users who want to customize their build experience? Fear not! jom also offers a convenient -j command-line argument, allowing you to specify the exact number of concurrent processes. This gives developers fine-grained control over the build process and ensures that they can tailor jom to their specific needs.

Before we get too excited about the benefits of jom, it's worth noting that this is still a work in progress. While jom is designed to be compatible with standard nmake Makefiles, there are a few rough edges to iron out. Nonetheless, even with its limitations, jom has already proven itself to be an indispensable tool for any Visual C++ developer looking to boost productivity.

And the best part? Installing and using jom is a breeze! Simply extract the ZIP file containing the binary to a directory in your system's PATH, and you're ready to go. In place of traditional nmake, call jom when compiling your Qt project – it will do the rest. On a quad-core machine with a Qt build, you can expect to see a significant reduction in compilation time.

The source code for jom is now available on gitorious! Be sure to check it out and join the community of developers who are already harnessing the power of this innovative build tool.

Update: As an added bonus, Jörg Bornemann has announced that the project has moved to gitorious! The source code is now available at http://qt.gitorious.org/qt-labs/jom. Be sure to check it out and get involved in the development of this exciting new tool!