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


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)

It seems there's an issue in Mono with .ThenBy … 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)
                .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.


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


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.

uContext is Editor PowerPack (more than 40 tools) that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features, corrects and improves the editor’s built-in behaviors. Click here to download uContext Basic for free.