A new version of System was added to project The Inbox:
http://source.squeak.org/inbox/System-ek.1062.mcz ==================== Summary ==================== Name: System-ek.1062 Author: ek Time: 19 June 2019, 3:38:42.256201 pm UUID: 4643bcbc-558c-4ef7-a550-2aa42261cb50 Ancestors: System-cmm.1061 Rename "sons" to "children" in MessageTally The rename is to make the terminology consistent with the common naming of tree items (i.e. parent and child). In MessageTally>>tallyPath:by: and >>tallyPath:in:by: the comments also already use "child". The current naming caused some confusion with our bachelor student teams. =============== Diff against System-cmm.1061 =============== Item was added: + ----- Method: MessageTally>>childrenOver: (in category 'comparing') ----- + childrenOver: threshold + + | hereTally last children | + receivers basicSize = 0 ifTrue: [^#()]. + hereTally := tally. + children := receivers select: "subtract subNode tallies for primitive hits here" + [:child | + hereTally := hereTally - child tally. + child tally > threshold]. + hereTally > threshold ifTrue: + [last := MessageTally new class: class method: method nesting: blockNesting. + last process: process. + last reportOtherProcesses: reportOtherProcesses. + ^children copyWith: (last primitives: hereTally)]. + ^children! Item was changed: ----- Method: MessageTally>>leavesInto:fromSender: (in category 'collecting leaves') ----- leavesInto: leafDict fromSender: senderTally | rcvrs | + rcvrs := self childrenOver: 0. - rcvrs := self sonsOver: 0. rcvrs size = 0 ifTrue: [ self into: leafDict fromSender: senderTally ] ifFalse: [ (reportOtherProcesses not and: [ rcvrs anyOne process isNil ]) ifTrue: [ ^self]. rcvrs do: [ :node | node isPrimitives ifTrue: [ node leavesInto: leafDict fromSender: senderTally ] ifFalse: [ node leavesInto: leafDict fromSender: self ]]]! Item was changed: ----- Method: MessageTally>>rootPrintOn:total:totalTime:threshold: (in category 'printing') ----- rootPrintOn: aStream total: total totalTime: totalTime threshold: threshold + | groups children | + children := self childrenOver: threshold. + groups := children groupBy: [ :aTally | aTally process ]. - | groups sons | - sons := self sonsOver: threshold. - groups := sons groupBy: [ :aTally | aTally process ]. groups keysAndValuesDo: [ :p :g | (reportOtherProcesses or: [ p notNil ]) ifTrue: [ aStream nextPutAll: '--------------------------------'; cr. aStream nextPutAll: 'Process: ', (p ifNil: [ 'other processes'] ifNotNil: [ p browserPrintString]); cr. aStream nextPutAll: '--------------------------------'; cr. + g sort do:[:aChild | + aChild - g sort do:[:aSon | - aSon treePrintOn: aStream tabs: OrderedCollection new thisTab: '' total: total totalTime: totalTime tallyExact: false orThreshold: threshold]]. ]! Item was removed: - ----- Method: MessageTally>>sonsOver: (in category 'comparing') ----- - sonsOver: threshold - - | hereTally last sons | - receivers basicSize = 0 ifTrue: [^#()]. - hereTally := tally. - sons := receivers select: "subtract subNode tallies for primitive hits here" - [:son | - hereTally := hereTally - son tally. - son tally > threshold]. - hereTally > threshold ifTrue: - [last := MessageTally new class: class method: method nesting: blockNesting. - last process: process. - last reportOtherProcesses: reportOtherProcesses. - ^sons copyWith: (last primitives: hereTally)]. - ^sons! Item was changed: ----- Method: MessageTally>>treePrintOn:tabs:thisTab:total:totalTime:tallyExact:orThreshold: (in category 'printing') ----- treePrintOn: aStream tabs: tabs thisTab: myTab total: total totalTime: totalTime tallyExact: isExact orThreshold: threshold + | children | - | sons | tabs do: [:tab | aStream nextPutAll: tab]. tabs size > 0 ifTrue: [self printOn: aStream total: total totalTime: totalTime tallyExact: isExact]. + children := isExact ifTrue: [receivers] ifFalse: [self childrenOver: threshold]. + children isEmpty - sons := isExact ifTrue: [receivers] ifFalse: [self sonsOver: threshold]. - sons isEmpty ifFalse: [tabs addLast: myTab. + children sort. + 1 to: children size do: [ :i | + | childTab | + childTab := i < children size ifTrue: [' |'] ifFalse: [' ']. + (children at: i) - sons sort. - 1 to: sons size do: [ :i | - | sonTab | - sonTab := i < sons size ifTrue: [' |'] ifFalse: [' ']. - (sons at: i) treePrintOn: aStream tabs: (tabs size < self maxTabs ifTrue: [tabs] ifFalse: [(tabs select: [:x | x = '[']) copyWith: '[']) + thisTab: childTab - thisTab: sonTab total: total totalTime: totalTime tallyExact: isExact orThreshold: threshold]. tabs removeLast]! |
Free forum by Nabble | Edit this page |