118
Faster Coroutine Pipelines: A Reconstruction Ruben Pieters 1 Tom Schrijvers

Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Faster Coroutine Pipelines:A Reconstruction

Ruben Pieters

1

Tom Schrijvers

Page 2: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

2

Page 3: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

3Data

Page 4: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

4

Result

Data

Page 5: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

5

Result

IO

Data

Page 6: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

6

[Data] -> IO Result

Page 7: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

7

[Data] -> IO Result

Page 8: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

8

Page 9: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

9

Stream Processing

Data Result

IO

Page 10: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

10

Stream Processing

Data Result

IO

Page 11: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

11

Stream Processing

Data Result

IO

Page 12: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

12

Stream Processing

Data Result

IO

Page 13: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

13

Page 14: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

14

Page 15: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

15

Data Result

IO

Page 16: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Stream Processing

16

Traditional1,2

Alternative3,4

1Pipes, Gonzalez, Haskell Library2Conduit, Snoyman, Haskell Library3Continuations and Transducer Composition, Shivers and Might, PLDI ‘064Faster Coroutine Pipelines, Spivey, ICFP ‘17

Page 17: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Overview

17

Page 18: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Goal

18

Introduction to● Traditional Representation1,2

● Alternative Representation3,4

1Pipes, Gonzalez, Haskell Library2Conduit, Snoyman, Haskell Library3Continuations and Transducer Composition, Shivers and Might, PLDI ‘064Faster Coroutine Pipelines, Spivey, ICFP ‘17

Page 19: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Our Paper

19

Traditional1,2

Alternative3,4

1Pipes, Gonzalez, Haskell Library2Conduit, Snoyman, Haskell Library3Continuations and Transducer Composition, Shivers and Might, PLDI ‘064Faster Coroutine Pipelines, Spivey, ICFP ‘17

Systematic Derivation

Page 20: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Story

20

hellooooooo world!!!

I only just worked out that the Moon landings were a hoax

hellooooooo world!!!

im a nice person!

Page 21: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Step 1: Generate And Tweet

21

hellooooooo world!!!

I only just worked out that the Moon landings were a hoax

hellooooooo world!!!

im a nice person!

Page 22: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Step 2: Filter Bad

22

hellooooooo world!!!

I only just worked out that the Moon landings were a hoax

hellooooooo world!!!

im a nice person!

Page 23: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Step 3: Filter Duplicates

23

hellooooooo world!!!

I only just worked out that the Moon landings were a hoax

hellooooooo world!!!

im a nice person!

Page 24: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Problem While Filtering Duplicates

24

Page 25: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Step 1: Generate And Tweet

25

Page 26: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

26

Pr(oducer) o m r

Page 27: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

27

Pr(oducer) o m r

o o

Page 28: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

28

Pr(oducer) o m r

o o

Page 29: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

29

Pr(oducer) o m r

o or

Page 30: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

30

: Pr String IO Ø

o o=

Page 31: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

31

Co(nsumer) i m r

Page 32: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

32

Co(nsumer) i m r

i i

Page 33: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

33

Co(nsumer) i m r

i i

Page 34: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

34

Co(nsumer) i m r

i i r

Page 35: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Producer/Consumer

35

: Co String IO Ø

= i i

Page 36: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

36

Page 37: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

37

merge

Page 38: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

38

a

a

a

a

Page 39: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

39

a

a

a

a

Page 40: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

40

a

a

a

a

Page 41: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

41

a

a

a

a

Page 42: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

42

a

a

a

a

Page 43: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

43

a

a

a

a

Page 44: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

44

a

a

a

a

Page 45: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

45

a

a

a

a

Page 46: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

46

a

a

a

a

Page 47: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Result Step 1

47

hellooooooo world!!!I only just worked out that the Moon landings were a hoax

Page 48: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Step 2: Filter Bad

48

Page 49: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Filter

49

filter

Page 50: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Pipe

50

P(ipe) i o m r

i

Page 51: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Pipe

51

P(ipe) i o m r

io

Page 52: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Pipe

52

P(ipe) i o m r

io

Page 53: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Pipe

53

= P(ipe) Ø o m rPr(oducer) o m r

Øo

Page 54: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Pipe

54

= P(ipe) i Ø m rCo(nsumer) o m r

Page 55: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

55

a

ia

i

oa

a

o

Page 56: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

56

a

ia

i

oa

a

o

Page 57: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

57

a

ia

i

oa

a

o

Page 58: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

58

a

ia

i

oa

a

o

i

Page 59: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

59

a

i

oa

a

o

i

ai

Page 60: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

60

a

i

oa

a

o

i

ai

Page 61: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

61

a

i

oa

a

o

i

ai

o

Page 62: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

62

a

i

oa

a

o

i

ai

oi

Page 63: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

63

a

i

oa

o

i

ai

oi

a

Page 64: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

64

a

i

oa

o

i

ai

oi

a

o

Page 65: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

65

a

i

oa

o

i

ai

oi

a

o

Page 66: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge

66

a

i

oa

o

i

ai

oi

a

o

pipes: (>->)conduit: (.|)

Page 67: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Filter

67

filter

Page 68: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Filter

68

isBad i

isGood i

i

o

Page 69: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Filter

69

i

o

i

o

Page 70: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Filter

70

=filter filteri

o

Page 71: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Filter

71

a a

a a

a

a

a

a

filter

Page 72: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Filter

72

a

a a

a

a

a

a

filter

Page 73: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Result Step 2

73

Page 74: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Result Step 2

74

hellooooooo world!!!

Page 75: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Result Step 2

75

hellooooooo world!!!I only just worked out that the Moon landings were a hoax

Page 76: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Step 3: Filter Duplicates

76

Page 77: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nub

77

nubfilter

Page 78: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nub

78

ao

Page 79: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nub

79

b

o

ao

/= a

Page 80: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nub

80

b

o

c

o

ao

/= a

/= a&&/= b

Page 81: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nub

81

= mergenub

filter(/= a)

io

nub

Page 82: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Result Step 3

82

nubfilter

Page 83: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Result Step 3

83

hellooooooo world!!!

I only just worked out that the Moon landings were a hoax

hellooooooo world!!!

im a nice person!

nubfilter

Page 84: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Result Step 3

84

Contains many merge calls

nubfilter

Page 85: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Merge Performance

85

Page 86: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation

86

Page 87: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Traditional Representation

87

o o

Pr o r = (o, … (o, Pr o r))

Page 88: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Traditional Representation

88

i i

Co i r = (λi. … (λi. Co i r))

Page 89: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation

89

o o

Pr o r: Ko -> r =

Page 90: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation

90

o o

Pr o r: Ko -> r =

λk. k o ( … (λk. k o ( Pr o r)))

Callback

Page 91: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation

91

o o

Pr o r: Ko -> r =

λk. k o ( … (λk. k o ( Pr o r)))

Page 92: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation

92

i i

Co i r: Ki -> r =

λk. k (λi k. … (λi. Co i r))

Page 93: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation

93

merge = f xwhere f = x =

i ii

o oo

Page 94: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation Pipe

94

io

?

Page 95: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation Pipe

95

io

P i o r: Ko -> K

i -> r =

Page 96: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Representation Pipe

96

io

P i o r: Ko -> K

i -> r =

λko k

i. k

i (λi k

o k

i. k

o o

(P i o r))

Page 97: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

97

mergeP = f xwhere f :

x : Ki -> K

a -> r

Ka -> K

o -> r

Page 98: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

mergeP = f xwhere f :

x : Ki -> K

a -> r

Ka -> K

o -> r

Alternative Pipe Merge

98

Page 99: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

a

Alternative Pipe Merge

99

mergeP = ? p qwhere p = q =

i

o

a

Page 100: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

100

mergeP = _ : Ki -> K

o -> r

where p : K

i -> K

a -> r

q : K

a -> K

o -> r

Page 101: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

101

mergeP = _ : Ki -> K

o -> r

where p : K

i -> K

a -> r

q : K

a -> K

o -> r

Page 102: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

102

mergeP = λko k

i. _ : r

where p : K

i -> K

a -> r

q : K

a -> K

o -> r

Page 103: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

103

mergeP = λko k

i. _ : r

where λx. p k

i x :

K

a -> r

λx. p x k

o : K

a ->

r

Page 104: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

104

mergeP = merge p’ q’where p’ : q’ :

i ii

o oo

Page 105: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

105

mergeP = p’ q’where p’ : q’ :

i ii

o oo

Page 106: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Alternative Pipe Merge

106

Page 107: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

107

i

a

a

aa

a

a

Page 108: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

108

i

a

a

aa

a

a

Page 109: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

109

i

a

a

aa

a

a

Page 110: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

110

i

a

a

aa

a

a

a

Intermediate de- and reconstruction

aa

a

Page 111: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

111

i

a

a

aa

a

a

aa

Intermediate de- and reconstruction

Page 112: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

112

i

a

a

aa

a

a

aa

Intermediate de- and reconstruction

ia

Page 113: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

113

i

a

a

aa

a

a

a

Intermediate de- and reconstruction

i

Page 114: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Traditional Merge

114

i

a

a

aa

a

a

i

a

a

Page 115: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Alternative Merge

115

i

a

a

aa

a

a

Pass the callback through the nested merge

Page 116: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Alternative Merge

116

i

a

a

aa

a

a

Pass the callback through the nested merge

Page 117: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Nested Alternative Merge

117

i

a

a

aa

a

a

Pass the callback through the nested merge

Page 118: Faster Coroutine Pipelines: A Reconstruction · hellooooooo world!!! I only just worked out that the Moon landings were a hoax hellooooooo world!!! im a nice person! Step 1: Generate

Our Paper

118

How can we derive the fast representation from the traditional one systematically?

[email protected] images from Machinarium