<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks to all! Another thing to add to my growing set of notes.<div><br><div><div>On Oct 3, 2008, at 4:41 PM, Mariano Abel Coca wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br>Actually, the definition of timeToRun in BlockContext is:<br><br>BlockContext>>timeToRun<br>&nbsp;&nbsp;&nbsp; "Answer the number of milliseconds taken to execute this block."<br><br>&nbsp;&nbsp;&nbsp; ^ Time millisecondsToRun: self<br> <br><br>So, your example it's the same than:<br><br>[ do some stuff here ] timeToRun<br><br>Remember: let the objects do the work for you :-)<br><br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 6:13 PM, Mark Volkmann <span dir="ltr">&lt;<a href="mailto:mark@ociweb.com">mark@ociweb.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style=""><div><div class="Ih2E3d"><div>On Oct 3, 2008, at 3:59 PM, Mariano Abel Coca wrote:</div> <br><blockquote type="cite"><div dir="ltr">I think you must be thinking in #timeToRun.</div></blockquote><div><br></div></div>No, but you saying that reminded me of where I saw it. It's in the Time class.</div><div><br> </div><div>ms := Time millisecondsToRun: [ do some stuff here ]</div><div><br></div><div>Using this on the code below, the comma approach took 8478 milliseconds and the stream approach took 185 milliseconds. Big difference!</div> <div><div>&nbsp;</div></div></div></blockquote><div>&nbsp;</div><div>Nice... I've never measured it ;)<br>&nbsp;<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style=""><div><div class="Wj3C7c"><div><br><blockquote type="cite"><div dir="ltr">About that... In VisualAge there are the EsbTracer and EsbSampler, which allows you to meassure the time that involves every message sent. It's useful to tune some code... But don't know in Squeak. Any ideas?<br> <br>Cheers,<br><br>-- <br>Mariano.<br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 5:44 PM, Mark Volkmann <span dir="ltr">&lt;<a href="mailto:mark@ociweb.com" target="_blank">mark@ociweb.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div>That reminds me. I know I ran across a method that runs a block and then tells you how long it took. Anyone remember what that's called?<div> <div><div></div><div><br><div><div>On Oct 3, 2008, at 3:09 PM, Mariano Abel Coca wrote:</div> <br><blockquote type="cite"><div dir="ltr"><span style="display: block; padding-left: 6em;"><span></span></span>Just check it by yourself. ;)<br> <div><div><div><span style="display: block; padding-left: 6em;"><span></span></span><span style="display: block; padding-left: 6em;"><span><br> |result|<br>100 timesRepeat:<br> [ result := String new.<br>  4000 timesRepeat: [ result := result, 'abcdefg' ]].<br> ^result<br> <br><br>|writer|<br>100 timesRepeat:<br> [ writer := <span>WriteStream</span> on: String new.<br>  4000 timesRepeat: [ writer nextPutAll:'abcdefg' ]].<br>^writer contents </span></span><br>Cheers,<br><br> -- <br>Mariano.<br><br><br><div class="gmail_quote">On Fri, Oct 3, 2008 at 2:02 PM, Herbert König <span dir="ltr">&lt;<a href="mailto:herbertkoenig@gmx.net" target="_blank">herbertkoenig@gmx.net</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hello Mark,<br> <br> Friday, October 3, 2008, 4:52:39 PM, you wrote:<br> <br> MV> Is there a reason to prefer one of these approaches over the other?<br> MV> Maybe one is more efficient and should be preferred if doing a large<br> MV> number of appends.<br> <br> speed is the reason for the stream approach. The #, approach copies<br> the first string once for each #, send.<br> <br> <br> MV> Are there other approaches I should consider?<br> <br> Don't know of any but then I'm not an expert.<br> <br> <br> Cheers,<br> <font color="#888888"><br> Herbert<br> </font><div><div></div><div><br> _______________________________________________<br> Beginners mailing list<br> <a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundation.org</a><br> <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br> </div></div></blockquote></div><br><br clear="all"><br> </div></div></div></div> _______________________________________________<br>Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundation.org</a><br> <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br></blockquote></div><br></div></div><div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div> <div><br>---</div><div>Mark Volkmann</div><div><br></div></div></span><br></span><br> </div><br></div></div><br>_______________________________________________<br> Beginners mailing list<br> <a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundation.org</a><br> <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br> <br></blockquote></div><br><br clear="all"><br><br><br> </div> _______________________________________________<br> Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org" target="_blank">Beginners@lists.squeakfoundation.org</a><br><a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br> </blockquote></div><br><div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style=""> <div><br>---</div><div>Mark Volkmann</div><div><br></div></div></span><br></span><br> </div><br></div></div></div><br>_______________________________________________<br> Beginners mailing list<br> <a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br> <a href="http://lists.squeakfoundation.org/mailman/listinfo/beginners" target="_blank">http://lists.squeakfoundation.org/mailman/listinfo/beginners</a><br> <br></blockquote></div><br><br clear="all"><br>-- <br>Mariano.<br><a href="http://www.egola.com.ar">www.egola.com.ar</a><br> </div> _______________________________________________<br>Beginners mailing list<br><a href="mailto:Beginners@lists.squeakfoundation.org">Beginners@lists.squeakfoundation.org</a><br>http://lists.squeakfoundation.org/mailman/listinfo/beginners<br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br class="Apple-interchange-newline">---</div><div>Mark Volkmann</div><div><br class="webkit-block-placeholder"></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"> </div><br></div></body></html>