<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Weak search performance on big solution (~100k elements to search)]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1415</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1415&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Weak search performance on big solution (~100k elements to search).]]></description>
		<lastBuildDate>Wed, 18 Dec 2019 19:12:14 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Weak search performance on big solution (~100k elements to search)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5835#p5835</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 18 Dec 2019 19:12:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5835#p5835</guid>
		</item>
		<item>
			<title><![CDATA[Weak search performance on big solution (~100k elements to search)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5834#p5834</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (ChrisHandzlik)]]></author>
			<pubDate>Wed, 18 Dec 2019 18:39:26 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5834#p5834</guid>
		</item>
	</channel>
</rss>
