I have automatically generated a huge, but very simple .cpp file. It defines a class:
#include <QString>
#include <map>
class CTrigramFrequencyTable_English
{
public:
CTrigramFrequencyTable_English();
private:
std::map<QString /*trigram*/, quint64 /*count*/> _trigramFrequencyTable;
const quint64 _totalTrigramCount;
};
and puts 10k lines of the following kind in the constructor:
_trigramFrequencyTable[QString("and")] = 48760ull;
I have started compiling this .cpp about 10 minutes ago, and it's still ongoing. Is there any way to achieve what I want and reduce compilation time? Why is it even taking so long? I've seen quite a few libraries with 3k-5k lines of regular code, even with templates, and it compiled very fast.
Bottom line - I don't want to put my data into a resource file and parse this file, I wanted to compile the data directly into the binary.
P. S. 10k lines file compiles in about 30 seconds in debug configuration; in release I waited for 10 minutes and terminated the process.