Sorting is slow
Closed this issue · 1 comments
whalleyboi commented
Everything works great for me building form the source except the sorting after generation
I comment out below and it generates the SDK, If I leave it in it takes 2 hours and sometimes doesnt complete. The generation on my PC already takes 45 minutes without sorting (20k objects)
SdkGenerator::ProcessPackages
if (!packages.empty())
{
state = "Sorting";
// std::sort doesn't work, so use a simple bubble sort
//std::sort(std::begin(packages), std::end(packages), PackageDependencyComparer());
const PackageDependencyComparer comparer;
for (auto i = 0u; i < packages.size() - 1; ++i)
{
for (auto j = 0u; j < packages.size() - i - 1; ++j)
{
state = std::to_string(i) + " - " + std::to_string(j);
if (!comparer(packages[j], packages[j + 1]))
{
std::swap(packages[j], packages[j + 1]);
}
}
}
}