<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.eiffelroom.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>eiffelroom - memory usage - Comments</title>
 <link>http://www.eiffelroom.org/tag/memory_usage</link>
 <description>Comments for &quot;memory usage&quot;</description>
 <language>en</language>
<item>
 <title>That&#039;s a good point. I don&#039;t</title>
 <link>http://www.eiffelroom.org/blog/ted_eiffel/extension_performance_comparison_among_lists#comment-459</link>
 <description>&lt;p&gt;That&#039;s a good point. I don&#039;t disconnect items in the lists. So GC basically only collects objects that were temporarily used in the list operations, rather than those tuples. This part of GC should be taken into account when measuring their performance of those lists. However, if I do tests creating no new tuples, we know performance of lists in real applications should be in between.&lt;br /&gt;
 I thought about another GC problem. I am not sure how GC exactly acts between &amp;quot;full_collect&amp;quot;s. I thought the later list testing could be affected by previous ones, as some stack chunks in the runtime may already allocated by previous testing in the same application.&lt;/p&gt;

</description>
 <pubDate>Thu, 22 May 2008 08:59:02 -0700</pubDate>
 <dc:creator>ted_eiffel</dc:creator>
 <guid isPermaLink="false">comment 459 at http://www.eiffelroom.org</guid>
</item>
<item>
 <title>Time spent in GC?</title>
 <link>http://www.eiffelroom.org/blog/ted_eiffel/extension_performance_comparison_among_lists#comment-458</link>
 <description>&lt;p&gt;One problem with linked lists is that it creates many objects, so it will trigger more GC cycles. So the benchmarks may look totally different if the code is part of a real application which already has a lot of objects in memory.&lt;/p&gt;

&lt;p&gt;Speaking about the GC, if you just want to measure the data structure impact, it might be worth trying to always insert the same tuple object instead of creating a new one at each iteration.&lt;/p&gt;

</description>
 <pubDate>Thu, 22 May 2008 02:35:26 -0700</pubDate>
 <dc:creator>ericb</dc:creator>
 <guid isPermaLink="false">comment 458 at http://www.eiffelroom.org</guid>
</item>
<item>
 <title>Avoid reallocation</title>
 <link>http://www.eiffelroom.org/blog/ted_eiffel/extension_performance_comparison_among_lists#comment-457</link>
 <description>&lt;p&gt;You should avoid reallocation by allocating a large memory block initially. Try allocating one twice the size you need - despite the unused memory allocated, it should still be faster than the linked version. Colin Adams&lt;/p&gt;

</description>
 <pubDate>Wed, 21 May 2008 23:47:16 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 457 at http://www.eiffelroom.org</guid>
</item>
<item>
 <title>Initial size.</title>
 <link>http://www.eiffelroom.org/blog/ted_eiffel/extension_performance_comparison_among_lists#comment-456</link>
 <description>&lt;p&gt;I didn&#039;t preallocate a size for arrayed lists. Firstly, I wanted to test the situation I completely don&#039;t know how many elements there would be. In practice, however, we can approximately evaluate the number of elements to be used. Secondly, yes, no doubt, the arrayed list is much faster and uses less memory, when known size is preallocated. That is an easy situation, if elements of the list are not frequently inserted/removed/moved, I choose that way without problem.&lt;br /&gt;
 Now even I don&#039;t preallocate size for arrayed lists, they seem faster when I know the number of elements is not too huge. That&#039;s to say, no matter if I preallocate the size, it is better to use arrayed lists as long as not many elements and no element moving around.&lt;br /&gt;
 When the number is very large, the big memory block reallocation is very slow for arrayed lists, so linked lists become faster since they only allocate small blocks of memory.&lt;/p&gt;

</description>
 <pubDate>Wed, 21 May 2008 17:55:17 -0700</pubDate>
 <dc:creator>ted_eiffel</dc:creator>
 <guid isPermaLink="false">comment 456 at http://www.eiffelroom.org</guid>
</item>
<item>
 <title>LINKED_LIST.extend and put_front ...</title>
 <link>http://www.eiffelroom.org/blog/ted_eiffel/extension_performance_comparison_among_lists#comment-455</link>
 <description>&lt;p&gt;LINKED_LIST.extend can have similar performance than LINKED_LIST.put_front if you take care of moving the cursor&lt;/p&gt;

&lt;p&gt;lst.extend (entry) lst.finish&lt;/p&gt;

&lt;p&gt;Otherwise, for each extend, it will search again for the last element. As far as arrayed list (or any fixed size), this is always much faster to initialize with the expected size, otherwise each time it resizes the underlying array, it will increase the size for its needs ... and then each time it is new allocation of memory.&lt;/p&gt;

</description>
 <pubDate>Wed, 21 May 2008 12:22:52 -0700</pubDate>
 <dc:creator>Jocelyn Fiat</dc:creator>
 <guid isPermaLink="false">comment 455 at http://www.eiffelroom.org</guid>
</item>
<item>
 <title>Initial sizes for arrayed lists</title>
 <link>http://www.eiffelroom.org/blog/ted_eiffel/extension_performance_comparison_among_lists#comment-453</link>
 <description>&lt;p&gt;These tests make linked lists look faster than arrayed lists. For arrayed lists, you should allocate the expected size - in this case the number of elements you are going to add.&lt;/p&gt;

&lt;p&gt;Then you should see a big difference.&lt;/p&gt;

&lt;p&gt;Colin Adams&lt;/p&gt;

</description>
 <pubDate>Wed, 21 May 2008 08:44:22 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 453 at http://www.eiffelroom.org</guid>
</item>
</channel>
</rss>
