It is not supposed to do:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
MessageTally class>>spyOn: aBlock
"
Spy on aBlock, in the current process. Can include or not statistics on
other processes in the report.
[1000 timesRepeat: [
100 timesRepeat: [120 factorial].
(Delay forMilliseconds: 10) wait
]] forkAt: 45 named: '45'.
MessageTally spyOn: [10000 timesRepeat: [1.23 printString]]
"
^self spyOn: aBlock reportOtherProcesses: false
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
I am not very familiar with the threading mechanism in Pharo, but since
factorial does not explicitly give the hand to other threads, how can other
threads be activated while the factoring is being computed?
Cheers,
Alexandre
On 23 Dec 2011, at 14:12, Nicolas Cellier wrote:
> Doesn't it tally several processes ? (finalization etc...)
>
> Nicolas
>
> 2011/12/23 Alexandre Bergel <[email protected]>:
>> Hi!
>>
>> MessageTally seems to give wrong values regarding the relative time spent.
>> Consider:
>> MessageTally spyOn: [ 100 timesRepeat: [ 1000 factorial ] ]
>>
>> It gives something like:
>> -=-=-=-=-=-=-=-=-=-=-=-=
>> - 377 tallies, 379 msec.
>>
>> **Tree**
>> --------------------------------
>> Process: (40s) 464519168: nil
>> --------------------------------
>> 65.8% {249ms} SmallInteger(Integer)>>factorial
>> 65.8% {249ms} SmallInteger(Integer)>>factorial
>> 65.8% {249ms} SmallInteger(Integer)>>factorial
>> 65.8% {249ms} SmallInteger(Integer)>>factorial
>> ...
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> I would expect to have 100% at the root of the call graph since other
>> threads are not reported.
>>
>> Is there something I am missing? If no, then I will dive into MessageTally.
>> This is annoying.
>>
>> Cheers,
>> Alexandre
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>>
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.