a promising approach to debugging remote promises thurs/03-leske-iwst2… · a promising approach...

Post on 25-May-2020

7 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

A PROMISING APPROACH TO DEBUGGING REMOTE

PROMISES

2016 Max Leske Andrei Chiș Oscar Nierstrasz

DISCLAIMER

MOTIVATION

request file list

display file list

receive file list

request file list

display file listreceive file list

request file list

PROMISE

receive file list

use

use

continue

fileListPromise := [ self getFileList ] promise.

fileListPromise value.…

request file list

what happened?

stack tracestack trace

descriptiondescription

NULLNULL

what happened?

exception object

IDEA

1sender

receiver1

Object

Context

CompiledMethod1method

Process

suspendedContext1

sender

nilsender

Process

suspendedContext

sender

nil

sender

Process1

suspendedContext

sender

nilsender

Process2

suspendedContext

sender

Process1+2

suspendedContext

sendersender

sender

sendernil

DEMO

MEMORY

object header: 64 bits

2

pinned / immutable

slots

8

identity hash

22

format

5

class index

22

unused

2

garbage collection

3

object header

extended header

slot 0 slot 1

slot 2 …

object

object header

Context

method

closureOrNil

stackp

receiver

sender pc

16 / 56 variable slots

no extended header required

96 / 256 bytes per instance

∑ ≪ 100 000 ~ 1000

small contexts: 96 kB

large contexts: 256 kB* 2 (reification)

small contexts: 192 kB

large contexts: 512 kB

estimated upper bounds

memory consumption of contexts:

object graph (simplified)

garbage collector

partially collected

garbage collector

not collected

copy

memory consumption of object graph: ?

PERFORMANCE

fileListPromise := [ self getFileList ] promise.

fileListPromise value.…

copy process full copy

reify contexts

copying stack of 100 000 frames

0 MS

125 MS

250 MS

375 MS

500 MS

SMALL CONTEXTS LARGE CONTEXTS SMALL CONTEXTS LARGE CONTEXTS

with GC without GC

performance:

REMOTE COMMUNICATION

protocol?

SeamlessSeamless

DEBUGGING

serialised process

local copy of process

proxies

THREADSpromises

events

asynchronous messages (actors)

asynchronous network requests

request file list

what happened?

copy process full copy

reify contexts

Process1+2

suspendedContext

sender

nil

sender

sender

sender

sender

top related