<?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[Unexplained Cpu Usage which is independent from Code]]></title><description><![CDATA[<p>Starting today i noticed a high CPU-usage in classes which have never been using that much. I started disabling those classes but the CPU-usage just went on to the next function like f.e.:</p>
<p>The workload went from GarbageCollector -&gt; Initialize -&gt; EventManager -&gt; Tower -&gt; Creeps -&gt; Spawner -&gt; Architect.</p>
<p>And as soon as i disabled all this classes it disappeared. As my code does not run in threads, it seems like the workload appears at a fixed time and does not occure if my code has been executed too fast.</p>
<p>I added an example below. There are no dependencies between those classes and initialize does nothing at all as it is only run on developing a new room.</p>
<p>Someone got an idea? Would be awesome!</p>
<p> </p>
<p> </p>
<p> </p>
<p><img src="https://s3.amazonaws.com/forum-static.screeps.com/44e81b48-73b9-4b30-bcab-990b4c608126.gif"></p>]]></description><link>http://screeps.com/forum/topic/64/unexplained-cpu-usage-which-is-independent-from-code</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Mar 2026 02:53:19 GMT</lastBuildDate><atom:link href="http://screeps.com/forum/topic/64.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 02 Jul 2017 11:35:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Unexplained Cpu Usage which is independent from Code on Invalid Date]]></title><description><![CDATA[<p>Starting today i noticed a high CPU-usage in classes which have never been using that much. I started disabling those classes but the CPU-usage just went on to the next function like f.e.:</p>
<p>The workload went from GarbageCollector -&gt; Initialize -&gt; EventManager -&gt; Tower -&gt; Creeps -&gt; Spawner -&gt; Architect.</p>
<p>And as soon as i disabled all this classes it disappeared. As my code does not run in threads, it seems like the workload appears at a fixed time and does not occure if my code has been executed too fast.</p>
<p>I added an example below. There are no dependencies between those classes and initialize does nothing at all as it is only run on developing a new room.</p>
<p>Someone got an idea? Would be awesome!</p>
<p> </p>
<p> </p>
<p> </p>
<p><img src="https://s3.amazonaws.com/forum-static.screeps.com/44e81b48-73b9-4b30-bcab-990b4c608126.gif"></p>]]></description><link>http://screeps.com/forum/post/345</link><guid isPermaLink="true">http://screeps.com/forum/post/345</guid><dc:creator><![CDATA[Fnoord]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Unexplained Cpu Usage which is independent from Code on Invalid Date]]></title><description><![CDATA[<p>It's most likely the Memory parse cost.  The first time you access memory, you incur the cost of unpacking the whole thing.</p>
<p>Try adding another 2 lines at the top:</p>
<p> </p>
<p>console.log('before memory', Game.cpu.getUsed());</p>
<p>Memory; // This will force the Memory to de-serialize and be read into the cache for use during the tick</p>
<p>&lt;rest of your code here&gt;</p>]]></description><link>http://screeps.com/forum/post/346</link><guid isPermaLink="true">http://screeps.com/forum/post/346</guid><dc:creator><![CDATA[Dewey]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>