The files selected from the "compile-commands.json" can potentially include duplicates. On a private repository, I had a factor of 3 duplication. After this change, the running time for the entire repo was slashed by half.
EDIT: Since "make_absolute()" is used, it is impossible that filenames such as "~/myfile.cpp" and "/home/user/myfile.cpp" are both present.
Would it be possible for the same file to still appear into two different paths? E.g., ~/myfile.cpp and /home/name/myfile.cpp?