<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 27, 2015 at 1:21 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu" target="_blank">leves@elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">AndreasSystemProfiler has the same bug, and it&#39;s annoyed me forever, so thanks for the fix.<br>
<br>
I&#39;m not an expert, but here&#39;s an example:<br>
<br>
AndreasSystemProfiler spyOn: [<br>
        [ #((1 2 3)) do: [ :each |<br>
                each findLast: [ :ea |<br>
                        ea squared = ea ] ] ] bench ].<br>
<br>
Before the patch you got:<br>
<br>
99.98 (5,018)  UndefinedObject  DoIt<br>
  10.39 (521)  Array [SequenceableCollection]  findLast:<br>
   9.68 (486)  Array [SequenceableCollection]  do:<br>
   5.94 (298)  Time class  millisecondClockValue<br>
<br>
But the profiled block doesn&#39;t send #findLast, nor #do:, and neither #millisecondClockValue. It sends #bench to a block, and nothing else.<br>
<br>
After the fix it&#39;s:<br>
<br>
99.98 (5,018)  UndefinedObject  DoIt<br>
  99.98 (5,018)  BlockClosure  bench<br>
    99.96 (5,017)  UndefinedObject  DoIt<br>
      20.9 (1,049)  Array [SequenceableCollection]  do:<br>
        |16.01 (804)  UndefinedObject  DoIt<br>
        |  16.01 (803)  Array [SequenceableCollection]  findLast:<br>
      5.7 (286)  Time class  millisecondClockValue<br>
<br>
Which is much better, and almost exact. #millisecondsClockValue is sent from #bench, not from a block.</blockquote><div><br></div><div>There&#39;s a printing bug there.  IMO it should look like</div><div><br></div><div> 99.98 (5,018)  UndefinedObject  DoIt</div>  99.98 (5,018)  BlockClosure  bench<br>    99.96 (5,017)  [] in UndefinedObject  DoIt<br>      20.9 (1,049)  Array [SequenceableCollection]  do:<br>        |16.01 (804)  [] in UndefinedObject  DoIt</div><div class="gmail_quote">        |  16.01 (803)  Array [SequenceableCollection]  findLast:<br>      5.7 (286)  Time class  millisecondClockValue</div><div class="gmail_quote"><br></div><div class="gmail_quote">I&#39;ll take a look.</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><font color="#888888"><br>
<br>
Levente</font></span><div class=""><div class="h5"><br>
<br>
On Tue, 27 Jan 2015, Chris Muller wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
This is easy for an expert to glance at and understand the nature of<br>
the bug but could someone explain it to help our Smalltalk-user<br>
community understand what has been wrong with MessageTally all these<br>
years?<br>
<br>
Thanks!<br>
<br>
On Tue, Jan 27, 2015 at 12:54 PM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 27.01.2015, at 19:37, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt; wrote:<br>
<br>
<br>
Wow, that&#39;s quite the bug :-)<br>
<br>
<br>
Indeed. I wonder how this could have ever worked. Or maybe just nobody<br>
noticed that certain chains were missing?<br>
<br>
- Bert -<br>
<br>
<br>
<br>
On Tue, Jan 27, 2015 at 8:53 AM, &lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Marcel Taeumel uploaded a new version of System to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/System-mt.697.mcz" target="_blank">http://source.squeak.org/<u></u>inbox/System-mt.697.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: System-mt.697<br>
Author: mt<br>
Time: 27 January 2015, 5:53:38.431 pm<br>
UUID: 9296f429-477d-0745-a878-<u></u>6e11e7de5edd<br>
Ancestors: System-cmm.696<br>
<br>
Let message tally ignore #home but just use #sender to handle block<br>
closures correctly.<br>
<br>
=============== Diff against System-cmm.696 ===============<br>
<br>
Item was changed:<br>
  ----- Method: MessageTally&gt;&gt;tally:by: (in category &#39;tallying&#39;) -----<br>
  tally: context by: count<br>
        &quot;Explicitly tally the specified context and its stack.&quot;<br>
        | sender |<br>
<br>
        &quot;Add to this node if appropriate&quot;<br>
        context method == method ifTrue: [^self bumpBy: count].<br>
<br>
        &quot;No sender? Add new branch to the tree.&quot;<br>
+       (sender :=  context sender) ifNil: [<br>
-       (sender :=  context home sender)ifNil: [<br>
                ^ (self bumpBy: count) tallyPath: context by: count].<br>
<br>
        &quot;Find the node for the sending context (or add it if necessary)&quot;<br>
        ^ (self tally: sender by: count) tallyPath: context by: count!<br>
<br>
Item was changed:<br>
  ----- Method: MessageTally&gt;&gt;tally:in:by: (in category &#39;tallying&#39;) -----<br>
  tally: context in: aProcess by: count<br>
        &quot;Explicitly tally the specified context and its stack.&quot;<br>
        | sender |<br>
<br>
        &quot;Add to this node if appropriate&quot;<br>
        context method == method ifTrue: [^self bumpBy: count].<br>
<br>
        &quot;No sender? Add new branch to the tree.&quot;<br>
+       (sender :=  context sender) ifNil: [<br>
-       (sender :=  context home sender) ifNil: [<br>
                ^ (self bumpBy: count) tallyPath: context in: aProcess by:<br>
count].<br>
<br>
        &quot;Find the node for the sending context (or add it if necessary)&quot;<br>
        ^ (self tally: sender in: aProcess by: count) tallyPath: context<br>
in: aProcess by: count!<br>
<br>
<br>
</blockquote>
<br>
<br>
<br>
--<br>
best,<br>
Eliot<br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>