Topic: Weak search performance on big solution (~100k elements to search)

Hi,

Thanks for creating the asset, it's clear you've put a lot of thought into this.

I've just been running search on a bigger project and that freezes the whole thing.
I've narrowed it down to
Assembly-CSharp-Editor-firstpass\Assets\Plugins\Infinity Code\uContext\Scripts\Editor\Windows\Search.cs : 618

When evaluating that in for each loop it kills performance, might be only visible with a lot of elements, I've got nearly 100k in those 'tempBestRecords'.

 tempBestRecords = tempBestRecords.OrderByDescending(r => r.Value.accuracy)
                .ThenBy(r => r.Value.label.Length)
                .ThenBy(r => r.Value.label)
                .Take(maxRecords)

It seems there's an issue in Mono with .ThenBy
https://stackoverflow.com/questions/146 … henby-sort

Seems like taking 'max records' and then doing more ordering does the trick (and probably you end up with similar results, not sure though)

 tempBestRecords = tempBestRecords.OrderByDescending(r => r.Value.accuracy)
                .Take(maxRecords)
                .OrderBy(r => r.Value.label.Length)
                .ThenBy(r => r.Value.label);

Hope you can incorporate that into new version, it's a buzz-kill not to have working search to start with.
Also some debounce when entering text phrase would be great, I've got fairly big solution and it around a 0.5s every key stroke.

Thanks,
Chris

Re: Weak search performance on big solution (~100k elements to search)

Hello.

It looks like you are using uContext v1.8 or older.
Search in uContext v1.9 is very high optimized and no longer uses LINQ in this form.
So simple update uContext through the built-in update system (Window / Infinity Code / uContext / Check Updates).

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!