<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[High CPU usage of Game.market.getAllOrders()]]></title><description><![CDATA[<p>I've noticed a call to Game.market.getAllOrders() takes around 4-5 CPU to execute, on shard0.</p>
<p>Perhaps a function call to get only certain orders (by resource, or type, or resource+type), or only a certain number of orders, rather than applying a filter to all orders would be faster?</p>
]]></description><link>http://screeps.com/forum/topic/2310/high-cpu-usage-of-game-market-getallorders</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 08:30:53 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/2310.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 08 Aug 2018 16:39:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to High CPU usage of Game.market.getAllOrders() on Invalid Date]]></title><description><![CDATA[<p>I've noticed a call to Game.market.getAllOrders() takes around 4-5 CPU to execute, on shard0.</p>
<p>Perhaps a function call to get only certain orders (by resource, or type, or resource+type), or only a certain number of orders, rather than applying a filter to all orders would be faster?</p>
]]></description><link>http://screeps.com/forum/post/10890</link><guid isPermaLink="true">http://screeps.com/forum/post/10890</guid><dc:creator><![CDATA[Maey]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to High CPU usage of Game.market.getAllOrders() on Invalid Date]]></title><description><![CDATA[<p>There actually is a filter option for that, while it does mention the lodash.filter method, IIRC, its cached and faster. <a href="https://docs.screeps.com/api/#Game.market.getAllOrders" rel="nofollow">https://docs.screeps.com/api/#Game.market.getAllOrders</a></p>
]]></description><link>http://screeps.com/forum/post/10891</link><guid isPermaLink="true">http://screeps.com/forum/post/10891</guid><dc:creator><![CDATA[ags131]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to High CPU usage of Game.market.getAllOrders() on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/2406">@maey</a>, there was an official <a href="https://blog.screeps.com/2016/09/Changelog-2016-09-30/" rel="nofollow">announcement</a> about indexing and caching.</p>
<p>Yep, plain (not-a-callback-like) filter will work much faster.</p>
<p>Definitely strange it isn't mentioned in documentation <img
      src="http://screeps.com/forum/plugins/nodebb-plugin-emoji/emoji/android/1f615.png?v=a1k070tfs06"
      class="not-responsive emoji emoji-android emoji--confused"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>http://screeps.com/forum/post/10892</link><guid isPermaLink="true">http://screeps.com/forum/post/10892</guid><dc:creator><![CDATA[Mototroller]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to High CPU usage of Game.market.getAllOrders() on Thu, 09 Aug 2018 22:51:26 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://screeps.com/forum/uid/43">@Mototroller</a> I'll give that a try, thanks for the info. It would definitely be useful if the documentation included the text at that announcement link.</p>
<p>Edit:
Yeah, that's much better, now taking around 0.3 CPU-units for a run.</p>
]]></description><link>http://screeps.com/forum/post/10914</link><guid isPermaLink="true">http://screeps.com/forum/post/10914</guid><dc:creator><![CDATA[Maey]]></dc:creator><pubDate>Thu, 09 Aug 2018 22:51:26 GMT</pubDate></item></channel></rss>