[Interest] Tricks to improve moc performance?

Uwe Rathmann Uwe.Rathmann at tigertal.de
Sat Dec 7 09:22:55 CET 2019


On 12/6/19 7:02 PM, Richard Weickelt wrote:

>> By the way: does anyone know about an implementation that avoids moc runs in
>> a similar way how ccache avoids compile runs ?
> 
> You mean concatenating header and source files containing a Q_OBJECT macro
> and feeding moc the result?

No - the ideas would be to calculate a hashsum from the files, that have 
an effect on the moc file and store it together with the moc file in a 
cache.

Then you have a replacement for moc, that compares the hashsum of the 
cache with the current hashsum and copies the cached moc file if they 
match - otherwise it is calling moc and copies the result into its cache.

Not 100% sure but IIRC this is how ccache works.

Uwe





More information about the Interest mailing list