Profiling the styling of a method using the virtual machine telemetry

Start by browse: BlElement>>#addChild:at: addChild: anElement at: anIndex "Add anElement at an index moving other children to the right. anElement must not be a direct child of any other element! anElement must not be nil anIndex must be greater or equal to 1 and less or equal than amount of existing children + 1" self assert: [ anElement isNotNil ] description: [ 'Can not add nil element' ]. self assert: [ anElement ~~ self ] description: [ 'Can not add an element as a child to itself' ]. anElement hasParent ifTrue: [ (BlAlreadyAddedAsChildError element: anElement) signal ]. self assert: [ anElement hasParent not ] description: [ 'Can not add child that is already added to another element!' ]. self assert: [ anIndex between: 1 and: self childrenCount + 1 ] description: [ 'anIndex must be within children array bounds' ]. "update parent" anElement parent: self. "actually add child" self children add: anElement at: anIndex. "dispatch events/hooks after element has been added" self dispatchChildAdded: anElement. "only requesting layout is not enough, because if size or position does not change there will be no invalidated bounds and nothing will be rendered" anElement invalidate. "We should request layout from newly added element to mark it as dirty too" anElement requestLayout. .

Start profiling for 10 seconds. Only perform the below without inspecting:

t := VirtualMachineAllProcessesSwitchTelemetry spyFor: 10 seconds
  

Modify BlElement>>#addChild:at: addChild: anElement at: anIndex "Add anElement at an index moving other children to the right. anElement must not be a direct child of any other element! anElement must not be nil anIndex must be greater or equal to 1 and less or equal than amount of existing children + 1" self assert: [ anElement isNotNil ] description: [ 'Can not add nil element' ]. self assert: [ anElement ~~ self ] description: [ 'Can not add an element as a child to itself' ]. anElement hasParent ifTrue: [ (BlAlreadyAddedAsChildError element: anElement) signal ]. self assert: [ anElement hasParent not ] description: [ 'Can not add child that is already added to another element!' ]. self assert: [ anIndex between: 1 and: self childrenCount + 1 ] description: [ 'anIndex must be within children array bounds' ]. "update parent" anElement parent: self. "actually add child" self children add: anElement at: anIndex. "dispatch events/hooks after element has been added" self dispatchChildAdded: anElement. "only requesting layout is not enough, because if size or position does not change there will be no invalidated bounds and nothing will be rendered" anElement invalidate. "We should request layout from newly added element to mark it as dirty too" anElement requestLayout. by adding a single character within that 10 seconds.

After the 10 seconds expired you get a notification. Inspect the profiling result:

t eventsByProcess mergedByParentProcess