Linked Weak Reference Arrays A Hybrid Approach to Efficient Bulk - - PowerPoint PPT Presentation

linked weak reference arrays
SMART_READER_LITE
LIVE PREVIEW

Linked Weak Reference Arrays A Hybrid Approach to Efficient Bulk - - PowerPoint PPT Presentation

Linked Weak Reference Arrays A Hybrid Approach to Efficient Bulk Finalization Andrs Valloud IWST 2015 Weak arrays ivars Weak arrays ivars Weak arrays mourn ivars 0 Ephemerons key Ephemerons key Ephemerons mourn key


slide-1
SLIDE 1

Linked Weak
 Reference Arrays

A Hybrid Approach to Efficient Bulk Finalization

Andrés Valloud

IWST 2015

slide-2
SLIDE 2

Weak arrays

ivars

slide-3
SLIDE 3

Weak arrays

ivars

slide-4
SLIDE 4

Weak arrays

ivars

mourn

slide-5
SLIDE 5

Ephemerons

key

slide-6
SLIDE 6

Ephemerons

key

slide-7
SLIDE 7

Ephemerons

key

mourn

slide-8
SLIDE 8

GemStone/S

Server Image GS Client

slide-9
SLIDE 9

GemStone/S

Server Image Ephemerons

slide-10
SLIDE 10

GemStone/S

Server Image Weak arrays

slide-11
SLIDE 11

Observation overhead

Ephemerons Weak arrays Evaluation Space required per client

  • bject

at least one extra

  • bject header

negligible weak arrays much more compact VM cost per client object

  • ne extra

finalization queue slot negligible weak arrays much more efficient in bulk Finalization cost per client

  • bject

ephemerons finalized only as needed scanning for tombstones weak arrays induce linear search

slide-12
SLIDE 12

No scanning, deployed

Begin interaction End interaction

slide-13
SLIDE 13

No scanning, deployed

Begin interaction End interaction

slide-14
SLIDE 14

No scanning, deployed

Begin interaction End interaction

H E N C E N O T O M B S T O N E S S T R O N G C O P Y

slide-15
SLIDE 15

No scanning, deployed

Begin interaction End interaction

O R I G I N A L L Y W E A K S T R O N G A T T H I S T I M E W E A K O N C E A G A I N

isWeakContainer: false isWeakContainer: true

slide-16
SLIDE 16

No scanning, proposed

Begin mourning End mourning WeakArray>>mourn 1 to: self size do: [:eachIndex | (self at: eachIndex) == 0 ifTrue: [self mournAt: eachIndex] ]

slide-17
SLIDE 17

No scanning, proposed

Begin mourning End mourning

6 12 15

LinkedWeakArray

slide-18
SLIDE 18

No scanning, proposed

Begin mourning End mourning

6 12 15

LinkedWeakArray>>mourn | nextIndex | nextIndex := self firstTombstoneIndex. "6" [nextIndex == 0] whileFalse: [ self mournAt: nextIndex. nextIndex := self at: nextIndex "12, 15, 0" ]

slide-19
SLIDE 19

No scanning, proposed

Begin GC End mourning

O R I G I N A L L Y W E A K S T R O N G A T T H I S T I M E W E A K O N C E A G A I N

setWeakContainer(false); isWeakContainer: true VM queues for finalization LinkedWeakArray>>mourn

slide-20
SLIDE 20

Mourning performance I

Quotient

0.0 0.6 1.3 1.9 2.6 3.2 3.9 4.5 5.2 5.8 6.5 7.1 7.8 8.4 9.1 9.7 10.4 11.0

Tombstoning rates

1 2 3 5 7 10

slide-21
SLIDE 21

Tombstoning
 rates

2^8 2^20

Linked weak
 array sizes

2^4 2^14

slide-22
SLIDE 22

Questions