Linked Weak Reference Arrays A Hybrid Approach to Efficient Bulk Finalization Andrés Valloud IWST 2015
Weak arrays ivars
Weak arrays ivars
Weak arrays mourn ivars 0
Ephemerons key
Ephemerons key
Ephemerons mourn key
GemStone/S Image GS Client Server
GemStone/S Image Ephemerons Server
GemStone/S Image Weak arrays Server
Observation overhead Ephemerons Weak arrays Evaluation Space required weak arrays at least one extra per client negligible much more object header object compact one extra weak arrays VM cost per finalization negligible much more client object queue slot efficient in bulk Finalization ephemerons weak arrays scanning for cost per client finalized only as induce linear tombstones object needed search
No scanning, deployed Begin interaction End interaction
No scanning, deployed Begin interaction 0 End interaction
No scanning, deployed Begin interaction S T R O N G C O P Y H E N C E N O T O M B S T O N E S End interaction
No scanning, deployed Begin interaction O R I G I N A L L Y W E A K isWeakContainer: false S T R O N G A T T H I S T I M E isWeakContainer: true W E A K O N C E A G A I N End interaction
No scanning, proposed Begin mourning 0 0 0 WeakArray>>mourn 1 to: self size do: [:eachIndex | (self at: eachIndex) == 0 ifTrue: [self mournAt: eachIndex] ] End mourning
No scanning, proposed Begin mourning 6 12 15 0 LinkedWeakArray End mourning
No scanning, proposed Begin mourning 6 12 15 0 LinkedWeakArray>>mourn | nextIndex | nextIndex := self firstTombstoneIndex. "6" [nextIndex == 0] whileFalse: [ self mournAt: nextIndex. nextIndex := self at: nextIndex "12, 15, 0" ] End mourning
No scanning, proposed Begin GC O R I G I N A L L Y W E A K VM queues for finalization setWeakContainer(false); S T R O N G A T T H I S T I M E LinkedWeakArray>>mourn isWeakContainer: true W E A K O N C E A G A I N End mourning
Mourning performance I 11.0 10.4 9.7 9.1 8.4 7.8 7.1 6.5 Quotient 5.8 5.2 4.5 3.9 3.2 2.6 1.9 1.3 0.6 0.0 1 2 3 5 7 10 Tombstoning rates
2^20 2^14 Tombstoning rates 2^8 Linked weak 2^4 array sizes
Questions
Recommend
More recommend