<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Weak search performance on big solution (~100k elements to search)]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1415&amp;type=atom" />
	<updated>2019-12-18T19:12:14Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1415</id>
		<entry>
			<title type="html"><![CDATA[Re: Weak search performance on big solution (~100k elements to search)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5835#p5835" />
			<content type="html"><![CDATA[<p>Hello.</p><p>It looks like you are using uContext v1.8 or older.<br />Search in uContext v1.9 is very high optimized and no longer uses LINQ in this form.<br />So simple update uContext through the built-in update system (Window / Infinity Code / uContext / Check Updates).</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-18T19:12:14Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5835#p5835</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Weak search performance on big solution (~100k elements to search)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5834#p5834" />
			<content type="html"><![CDATA[<p>Hi,</p><p>Thanks for creating the asset, it&#039;s clear you&#039;ve put a lot of thought into this.</p><p>I&#039;ve just been running search on a bigger project and that freezes the whole thing.<br />I&#039;ve narrowed it down to<br />Assembly-CSharp-Editor-firstpass\Assets\Plugins\Infinity Code\uContext\Scripts\Editor\Windows\Search.cs : 618</p><p>When evaluating that in for each loop it kills performance, might be only visible with a lot of elements, I&#039;ve got nearly 100k in those &#039;tempBestRecords&#039;.</p><div class="codebox"><pre><code> tempBestRecords = tempBestRecords.OrderByDescending(r =&gt; r.Value.accuracy)
                .ThenBy(r =&gt; r.Value.label.Length)
                .ThenBy(r =&gt; r.Value.label)
                .Take(maxRecords)</code></pre></div><p>It seems there&#039;s an issue in Mono with .ThenBy<br /><a href="https://stackoverflow.com/questions/14667093/efficient-implementation-of-a-thenby-sort">https://stackoverflow.com/questions/146 … henby-sort</a></p><p>Seems like taking &#039;max records&#039; and then doing more ordering does the trick (and probably you end up with similar results, not sure though)</p><div class="codebox"><pre><code> tempBestRecords = tempBestRecords.OrderByDescending(r =&gt; r.Value.accuracy)
                .Take(maxRecords)
                .OrderBy(r =&gt; r.Value.label.Length)
                .ThenBy(r =&gt; r.Value.label);</code></pre></div><p>Hope you can incorporate that into new version, it&#039;s a buzz-kill not to have working search to start with. <br />Also some debounce when entering text phrase would be great, I&#039;ve got fairly big solution and it around a 0.5s every key stroke.</p><p>Thanks,<br />Chris</p>]]></content>
			<author>
				<name><![CDATA[ChrisHandzlik]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1177</uri>
			</author>
			<updated>2019-12-18T18:39:26Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5834#p5834</id>
		</entry>
</feed>
