Juan I fixed it in the subsequent release but could you have a look
and if necessary I will remove it. Stef On Jul 20, 2009, at 8:54 PM, Juan Vuletich wrote: > stephane ducasse wrote: >> Hi >> >> I spent some time looking at the enh of juan and the results are >> really cool. >> Thanks Juan for making that available. (BTW if you can sign and >> send/fax me the pharo license it will be easier for the future) >> I updated the class comments: >> >> You can also see the results using the Debug menu :) >> > > Hi Stef, > > I'm glad to be of help. Just a comment. I did not include > #spyAt:on: . I don't think it is good. With it, if I remember > correctly, in your example, > > > Here we do not see factorial since it is run at a high > priority > > [1000 timesRepeat: [ > > 100 timesRepeat: [120 factorial]. > > (Delay forMilliseconds: 10) wait > > ]] forkAt: 45 named: '45'. > > MessageTally spyAt: 40 on: [10000 timesRepeat: > [1.23 printString]] > > the time used by the factorial will be assigned to some random lower > priority process. I think this is a bug, and I recommend removing > #spyAt:on: > > BTW, I'll send you the license agreement. Is a digital photo of the > signed paper ok? > > Cheers, > Juan Vuletich > _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
I imagine that this is this one
spyEvery: millisecs at: spyPriority on: aBlock "Create a spy and spy on the given block at the specified rate." | myDelay startTime time0 observedProcess | (aBlock isMemberOf: BlockClosure) ifFalse: [self error: 'spy needs a block here']. self class: aBlock receiver class method: aBlock method. "set up the probe" observedProcess := Processor activeProcess. myDelay := Delay forMilliseconds: millisecs. time0 := Time millisecondClockValue. gcStats := SmalltalkImage current getVMParameters. Timer := [ [true] whileTrue: [ startTime := Time millisecondClockValue. myDelay wait. self tally: Processor preemptedProcess suspendedContext in: (ShowProcesses ifTrue: [ observedProcess == Processor preemptedProcess ifTrue: [observedProcess] ifFalse: [nil]]) "tally can be > 1 if ran a long primitive" by: (Time millisecondClockValue - startTime) // millisecs]. nil] newProcess. Timer priority: spyPriority. "activate the probe and evaluate the block" Timer resume. ^ aBlock ensure: [ "Collect gc statistics" SmalltalkImage current getVMParameters keysAndValuesDo: [ :idx :gcVal | gcStats at: idx put: (gcVal - (gcStats at: idx))]. "cancel the probe and return the value" Timer terminate. time := Time millisecondClockValue - time0] _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |