-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
159 additions
and
611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Class { | ||
#name : #BlBFFICounterMeter, | ||
#superclass : #BlBMeter, | ||
#instVars : [ | ||
'functionNamesAndCounts' | ||
], | ||
#category : #'BlocBenchs-Core' | ||
} | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBFFICounterMeter >> reportResultsFrom: aBlBBlocBenchRunner in: aBlBResult [ | ||
|
||
aBlBResult | ||
addField: #totalFFICallsPerFrame | ||
title: 'Total FFI Calls per frame' | ||
value: functionNamesAndCounts values sum. | ||
|
||
aBlBResult | ||
addField: #ffiCalls | ||
title: 'FFI Calls per frame' | ||
value: functionNamesAndCounts. | ||
|
||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBFFICounterMeter >> startMetering: aBlBBlocBenchRunner [ | ||
|
||
"Ensure prepared" | ||
TFLSignal install. | ||
TFLFunctionCounter resetInstance. | ||
|
||
"Really start" | ||
TFLFunctionCounter start. | ||
|
||
aBlBBlocBenchRunner space enableStatistics. | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBFFICounterMeter >> stopMetering: aBlBBlocBenchRunner [ | ||
|
||
"Extract relevant information of the global logger, and reset it." | ||
|
||
| frameCount | | ||
|
||
frameCount := aBlBBlocBenchRunner space spaceStatistics totalFrames. | ||
|
||
functionNamesAndCounts := TFLFunctionCounter instance functionNamesAndCounts. | ||
functionNamesAndCounts := OrderedDictionary newFrom: | ||
(functionNamesAndCounts associations sorted: [ :a :b | | ||
a value > b value ]). | ||
functionNamesAndCounts := functionNamesAndCounts | ||
collect: [ :value | (value / frameCount) asFloat ]. | ||
|
||
TFLSignal uninstall. | ||
TFLFunctionCounter stop; resetInstance. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Class { | ||
#name : #BlBFFILogger, | ||
#superclass : #BlBMeter, | ||
#instVars : [ | ||
'loggerCopy' | ||
], | ||
#category : #'BlocBenchs-Core' | ||
} | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBFFILogger >> reportResultsFrom: aBlBBlocBenchRunner in: aBlBResult [ | ||
|
||
aBlBResult | ||
addField: #ffiCallsLog | ||
title: 'FFI Calls' | ||
value: loggerCopy | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBFFILogger >> startMetering: aBlBBlocBenchRunner [ | ||
|
||
"Ensure prepared" | ||
TFLSignal install. | ||
TFLCallLogger resetInstance. | ||
TFLCallLogger instance entryCount: 20000. | ||
|
||
"Really start" | ||
TFLCallLogger instance start | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBFFILogger >> stopMetering: aBlBBlocBenchRunner [ | ||
|
||
"Store a copy of the global logger, and reset it." | ||
|
||
loggerCopy := TFLCallLogger instance copy. | ||
|
||
TFLSignal uninstall. | ||
TFLCallLogger stop; resetInstance. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Class { | ||
#name : #BlBSystemProfilerMeter, | ||
#superclass : #BlBMeter, | ||
#instVars : [ | ||
'profiler' | ||
], | ||
#category : #'BlocBenchs-Core' | ||
} | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBSystemProfilerMeter >> reportResultsFrom: aBlBBlocBenchRunner in: aBlBResult [ | ||
|
||
| flameGraph | | ||
|
||
flameGraph := profiler saucoAsReport | ||
colorMap: | ||
(SaCategoryPrefixColorMap new | ||
mapPrefixes: #( | ||
'OSWindow' | ||
'Alexandrie') | ||
from: Color lightBlue; | ||
mapPrefixes: #( | ||
'Bloc-Text' | ||
'BlocHost' | ||
'Bloc') | ||
from: Color orange; | ||
mapPrefixes: #( | ||
'Album' | ||
'Toplo') | ||
from: Color pink; | ||
yourself) . | ||
|
||
aBlBResult | ||
addField: #systemProfilerReport | ||
title: 'System Profiler Report' | ||
value: profiler report. | ||
|
||
aBlBResult | ||
addField: #flameGraph | ||
title: 'Flame Graph' | ||
value: flameGraph. | ||
|
||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBSystemProfilerMeter >> startMetering: aBlBBlocBenchRunner [ | ||
|
||
profiler := AndreasSystemProfiler new. | ||
profiler startProfiling | ||
] | ||
|
||
{ #category : #'as yet unclassified' } | ||
BlBSystemProfilerMeter >> stopMetering: aBlBBlocBenchRunner [ | ||
|
||
profiler stopProfiling | ||
] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.