fileapi: very slow configuration on a big project
I just tried using the fileapi on the cmake project generated by UnrealEngine.
A reconfiguration of the project without "fileapi queries" takes
3.27s user 4.36s system 92% cpu 8.253 total
a reconfiguration with fileapi queries is 16x time slower
126.07s user 6.20s system 99% cpu 2:13.36 total
I used Instruments to profile CMake, and it looks like cmFileAPICodemodelDump(cmFileAPI&, unsigned long) takes the bulk of the time. Drilling down a bit, most of the JSON operations are the bottleneck.
I think it's a bit unreasonable to have such a big slowdown.
The query files were: cache-v2 cmakeFiles-v1 and codemodel-v2
The Unreal engine project lists about ~50 targets and 9000 source files.
I discovered this while trying out the new CMake fileapi support in Qt Creator (which makes the initial configuration of a project inside the IDE unreasonably slow).
But the same happens when doing the configuration on the command line, those were the times I provided.