<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div><div><div>On 14-lug-10, at 14:34, Steve Schveighoffer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hm... did you mean to reply to the newCapacity message?<br><br>Even if that is the case, I don't really understand what you are saying here...<br><br>-Steve<br><br></div></blockquote>Sorry, I had written a first reply to the newCapacity message, and it seems that that first reply for unknown reasons did not go through to the list... so my second reply was indeed without context...<div><br></div><div>as It was not really correct, I just put here an excerpt for completeness sake</div><div>------</div><div>Again I am not too sure, I flip flopped a couple of times implementing&nbsp;<a href="http://github.com/fawzi/blip/blob/master/blip/util/Grow.d">http://github.com/fawzi/blip/blob/master/blip/util/Grow.d</a>&nbsp;, a version of which I had also used in tango.<br><br>basically if you append to an array do you want the appending be determined by the number of elements of the array, or its size?<br>Code will probably work depending on the number of elements of the array, not on its memory usage.<br>In the end it is just a factor, but if you have many small elements I feel that it if "reasonable" to allocate a smaller amount of extra space.<br>On the other hand as you pointed out if you thing strictly from the memory point of view, one can argue that the percentile of extra space should depend only on the space used, not on how it is used internally.<br><br>Finally I kept the "per element" view, but that was done without any real testing<br><blockquote type="cite"></blockquote></div><div><br></div><div>(in reality I grow strictly on memory and the use the element size to round up, guaranteeing nice behavior for arrays with few large elements).</div><div>--------</div><div><br></div><div>about the sub page grows I am not sure if I agree, choosing those special sizes matches the sizes of the bins in the GC, so it makes sense to have special sizes</div><blockquote type="cite"><div><br><br>----- Original Message ----<br><blockquote type="cite">From: Fawzi Mohamed &lt;<a href="mailto:fawzi@gmx.ch">fawzi@gmx.ch</a>&gt;<br></blockquote><blockquote type="cite">To: D's runtime library developers list &lt;<a href="mailto:d-runtime@puremagic.com">d-runtime@puremagic.com</a>&gt;<br></blockquote><blockquote type="cite">Sent: Wed, July 14, 2010 8:20:46 AM<br></blockquote><blockquote type="cite">Subject: Re: [D-runtime] Extending pages in GC<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">ehm, it seems that it was too long ago that I worked on that code.<br></blockquote><blockquote type="cite">Indeed I &nbsp;flip-flopped one more time it seem, and I also decided to grow only <br></blockquote><blockquote type="cite">based on &nbsp;memory usage.<br></blockquote><blockquote type="cite">The element size is used just to round the result to a multiple &nbsp;of the element <br></blockquote><blockquote type="cite">size...<br></blockquote><blockquote type="cite">(this can have a large impact with arrays with few &nbsp;large elements, I think it <br></blockquote><blockquote type="cite">is &nbsp;correct)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Fawzi<br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">D-runtime &nbsp;mailing list<br></blockquote><blockquote type="cite"><a href="mailto:D-runtime@puremagic.com">D-runtime@puremagic.com</a><br></blockquote><blockquote type="cite"><a href="http://lists.puremagic.com/mailman/listinfo/d-runtime">http://lists.puremagic.com/mailman/listinfo/d-runtime</a><br></blockquote><blockquote type="cite"><br></blockquote><br><br><br>_______________________________________________<br>D-runtime mailing list<br><a href="mailto:D-runtime@puremagic.com">D-runtime@puremagic.com</a><br>http://lists.puremagic.com/mailman/listinfo/d-runtime<br></div></blockquote></div><br></div></div></body></html>