Skip to content

Commit

Permalink
Fixed plotter for allocation sites classification. Minor other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanmontt committed Sep 18, 2024
1 parent 330a870 commit 81472f2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
27 changes: 17 additions & 10 deletions src/IllimaniProfiler/IllAnalyzer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ Class {
'maxLiveSize',
'groupedAllocationSites',
'startTime',
'endTime'
'endTime',
'taThreshold',
'hif',
'hlf'
],
#category : 'IllimaniProfiler-Analyzer',
#package : 'IllimaniProfiler',
Expand Down Expand Up @@ -67,12 +70,7 @@ IllAnalyzer >> calculateMaxLiveSize [
{ #category : 'api' }
IllAnalyzer >> classifyAllocationSites [

| hif hlf |

self binObjects.

hif := 0.
hlf := 0.6.

groupedAllocationSites valuesDo: [ :allocationSiteBin |
| is ss ls wasClassified |
Expand Down Expand Up @@ -105,7 +103,7 @@ IllAnalyzer >> groupAllocationSites [
groupedAllocationSites
at: illAllocationSite
ifAbsentPut: (IllAllocationSiteBin new
allocatorMethod: illAllocationSite;
allocationSite: illAllocationSite;
yourself) ]
]

Expand All @@ -115,7 +113,11 @@ IllAnalyzer >> initialize [
super initialize.
immortalObjectsBin := OrderedCollection new: 100000.
shortObjectsBin := OrderedCollection new: 100000.
longObjectsBin := OrderedCollection new: 10000
longObjectsBin := OrderedCollection new: 10000.

taThreshold := 0.45.
hif := 0.
hlf := 0.6
]

{ #category : 'calculating' }
Expand All @@ -133,8 +135,7 @@ IllAnalyzer >> isObjectImmortal: illEphe [
{ #category : 'calculating' }
IllAnalyzer >> isObjectShortLived: illEphe [

| age taThreshold |
taThreshold := 0.45.
| age |
age := illEphe lifetime / self maxLiveSize.
^ age < (taThreshold * self maxLiveSize)
]
Expand Down Expand Up @@ -166,6 +167,12 @@ IllAnalyzer >> pruneAllocationSites [
allocationSiteBin totalAllocations < (v * totalProgramAllocations) ]
]

{ #category : 'accessing' }
IllAnalyzer >> shortObjectsBin [

^ shortObjectsBin
]

{ #category : 'accessing' }
IllAnalyzer >> startTime [
^ startTime
Expand Down
12 changes: 6 additions & 6 deletions src/IllimaniUI/IllAnalyzerPlot.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IllAnalyzerPlot >> analyzer: anObject [
analyzer := anObject
]

{ #category : 'as yet unclassified' }
{ #category : 'api' }
IllAnalyzerPlot >> plot [

| chart plot deathTimes ages shortLivedThreshold |
Expand All @@ -25,17 +25,17 @@ IllAnalyzerPlot >> plot [

plot := RSScatterPlot new
x: deathTimes y: ages;
xlabel: 'Object time of death relative to total allocation';
ylabel: 'Object age relative to total allocation';
maxChartValueX: 1;
yourself.

shortLivedThreshold := ages max * 0.45.
shortLivedThreshold := (analyzer shortObjectsBin max: #lifetime) / analyzer totalTime.

chart := RSCompositeChart new
add: plot;
add: (RSLinePlot new x: #(1 0) y: #(0 1); color: Color black);
add: (RSLinePlot new x: {1 . 0} y: {0.05 . 0.05}; color: Color black);
add: (RSLinePlot new x: {plot maxValueX . 0} y: {0 . plot maxValueY}; color: Color black);
add: (RSLinePlot new x: {plot maxValueX . 0} y: {shortLivedThreshold . shortLivedThreshold}; color: Color black);
xlabel: 'Object time of death relative to total allocation';
ylabel: 'Object age relative to total allocation';
yourself.

chart title: ''.
Expand Down

0 comments on commit 81472f2

Please sign in to comment.