CorrM / Unreal-Finder-Tool

Useful tool to help you fetch and dump Unreal Engine 4 Games information.
GNU General Public License v3.0
431 stars 169 forks source link

Sorting is slow #57

Closed whalleyboi closed 5 years ago

whalleyboi commented 5 years ago

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]);
                }
            }
        }
    }
CorrM commented 5 years ago

i know sorting is shity, it's form the base generator. i Already fixed all this kind of problems in UDA but it's still in development and i don't recommend to use it now.

so until the release use UFT.