[SOLVED] MOC very slow on WIndows in Qt 5.3.1
I am moving from Qt 4.8 to 5.3.1 and have encountered a speed issue with MOC. My project used to take about 1 hour to do a full rebuild and now takes about 6 hours. There are a few differences (VS2008 versus VS2013) and of course the Qt version. The vast majority of the time is used in the MOC'ing of files.
Qt 4.8 - Win 7, 64 bit VMWare virtual machine running under MacOS with the source code and Qt local on the C: disk, Visual Studio 2008
Qt 5.3 - Win 7, 64 bit VM running on the same Mac, with source code on a shared disk and Qt on the local C: disk, Visual Studio 2013
Any ideas of why the MOC would take so long ? Anyone else experiencing MOC slowness with QT 5.3.1?
Hi, and welcome to the Qt DevNet!
I haven't noticed slowness with moc before, but maybe that's because my projects aren't that large.
Do you have an antivirus or other security software running on your VMs? It might slow down compilations by scanning every call to moc.
I have the same antivirus on both VM's. Just removed it totally from the VS 2013 system and get the same slow speeds. Thanks for the suggestion, I had not considered that as a possible cause.
what's that "shared disk"? This "shared disk" thingie must be the cause.
The shared disk (drive letter mount of the host Mac Disk) was used on another machine under Qt 4.8 with no effect on MOC speed. It also has no effect on the compile speed or SQL database speed as compared to having local C: drive files. Just included this info in case someone had seen the same problem on a virtual machine using the Qt 5 version of MOC.
What happens if you move your files into a "local" folder before running moc?
When you said "I am moving from Qt 4.8 to 5.3.1", did you mean you upgraded Qt but kept your original VM, or did you create a new VM too?
Did you upgrade VMWare itself during your move?
MOC in Qt 5 apparently has speed issues with accessing files via a shared disk mount. I moved every thing to C:\ and the MOC speed is now the same as in Qt 4.8.
Anyone have ideas why having the code on VMWare host shared disk would cause MOC to run very, very slow ? It has no effect on the speed of the VC++ compile or a number of other tools.
- The moc speed issue disappears using a local folder.
2, I migrated all of our code from Qt 4.8 to Qt 5.3.1 this summer and also migrated from VS2008 to VS 2013. I created a new VM with the same OS (Win 7 Ultimate) for the VS 2013. I still have VM with the Qt 4.8 version.
- Last VMWare upgrade that I did was earlier this year before I started the 4.8 to 5.3.1 code migration.
Thank you for any insight. We are building on 2 different VM's now (CentOS 7 and Win 7) and will soon also be building on MacOS. This is why I would really like to maintain one copy of the code on the host machine shared between multiple operating systems.
From your descriptions, it sounds like the slowness is related to the way moc and/or Qt accesses files on disk, as well as how VMWare implements shared disks. In your scenario, VMWare did not change, which means that something changed in moc and/or Qt.
You can bring this to the attention of Qt engineers at the "Interest mailing list":http://lists.qt-project.org/mailman/listinfo/interest if you'd like (subscribe first, then you can post). Perhaps they can give you the details of what changed between Qt 4.8 and Qt 5, or even improve the performance.
[quote author="dherold" date="1411959522"]We are building on 2 different VM's now (CentOS 7 and Win 7) and will soon also be building on MacOS. This is why I would really like to maintain one copy of the code on the host machine shared between multiple operating systems.[/quote]The proper way to manage this is to use a version control system, like "git":http://git-scm.com/.
You can host your code somewhere, and pull the latest version to the local disk when you want to build. You can choose between command-line tools or GUI tools like "SourceTree":http://www.sourcetreeapp.com/.
Or for a faster but less robust solution, you could use a tool like "FreeFileSync":http://sourceforge.net/projects/freefilesync/ to sync the local copy with the host copy before you build.
Thank you JKSH. I recently moved to Git from an old CVS system. We will do as you suggest and keep a local copy on each VM. I will also get onto the interest mailing list. Thanks again, Dan