EMF Compare 2.0: Scaling to Millions (updated)

100
EMF Compare 2 Scaling to Millions Mikaël Barbero 26 March 2013

description

Slides from the Eclipse Con North America 2013 presentation

Transcript of EMF Compare 2.0: Scaling to Millions (updated)

Page 1: EMF Compare 2.0: Scaling to Millions (updated)

EMF Compare 2

Scaling to Millions

Mikaël Barbero 26 March 2013

Page 2: EMF Compare 2.0: Scaling to Millions (updated)

EMF Compare 2.0

http

://id

ealis

tpro

paga

nda.

blog

spot

.fr/2

010/

04/im

agina

ry-fo

unda

tions

-mak

e-di

ffere

nce.

htm

l

Released mid-september 2012

Sponsored by Ericssonunder Polarsys and Modeling Platform

Working Group (MPWG)

Page 3: EMF Compare 2.0: Scaling to Millions (updated)

Goal: Performance

http

://w

ww.

flick

r.com

/pho

tos/

9781

230@

N06

/227

0505

202

But also simpler API, better understanding of differences for end-users...

Should relate to number of differences, not to the size

of the model

Page 4: EMF Compare 2.0: Scaling to Millions (updated)

Brand New UI Better integration with Team/Compare

Page 5: EMF Compare 2.0: Scaling to Millions (updated)

Demo

Because it worths a thousand words

http://www.flickr.com/photos/viggum/2417430161/

Page 6: EMF Compare 2.0: Scaling to Millions (updated)

How does it works? in a Nutshell

Page 7: EMF Compare 2.0: Scaling to Millions (updated)

Match

Page 8: EMF Compare 2.0: Scaling to Millions (updated)

Two Strategies

Page 9: EMF Compare 2.0: Scaling to Millions (updated)

Two Strategies

Technical IDXMI:id, resource URI + URI fragment,

your own...

Page 10: EMF Compare 2.0: Scaling to Millions (updated)

Two Strategies

Technical IDXMI:id, resource URI + URI fragment,

your own...

Content basedHeuristics, String distance

Page 11: EMF Compare 2.0: Scaling to Millions (updated)

Differencing

http://www.flickr.com/photos/brianjmatis/3209203494/

Page 12: EMF Compare 2.0: Scaling to Millions (updated)

Rationalization

Longest Common Subsequencehttp://www.youtube.com/watch?v=RUckZMzqUcw

Page 13: EMF Compare 2.0: Scaling to Millions (updated)

Dependencies

http://www.flickr.com/photos/qilin/2262821682/

Page 14: EMF Compare 2.0: Scaling to Millions (updated)

Requirements between differences

Package 1

State machine 1

Addition of ‘Package 1’ within ‘something’

Addition of ‘State Machine 1’ within ‘Package 1’

requires the merge of

Page 16: EMF Compare 2.0: Scaling to Millions (updated)

Equivalence between differences

Class 1

Property 1

Setting ‘Property 1’ to reference ‘Associtation 1’

Setting ‘Association 1’ to reference ‘Property 1’

the merge is equivalent to

Association 1

ass.ends

‘ass.’ and ‘ends’ are opposite references

Page 18: EMF Compare 2.0: Scaling to Millions (updated)

Match

Difference

Equivalence

Requirement

Conflict

Summary

Page 19: EMF Compare 2.0: Scaling to Millions (updated)

How to scale to Millions?

http://www.flickr.com/photos/somemixedstuff/2403249501/

Page 20: EMF Compare 2.0: Scaling to Millions (updated)

A graph of EObjects

A «logical» EMF model

Page 21: EMF Compare 2.0: Scaling to Millions (updated)

A graph of EObjects

In Resources

A

G

D

B

C

F

E

Page 22: EMF Compare 2.0: Scaling to Millions (updated)

A graph of EObjects

Cross-resources links

A

G

D

B

C

F

E

Page 23: EMF Compare 2.0: Scaling to Millions (updated)

A graph of Resources

A

G

D

B C

F

E

Page 24: EMF Compare 2.0: Scaling to Millions (updated)

Left (local)

Right (remote)

Ancestor

A

G

D

B C

F

E

A

G

D

B C

F

E

A

G

D

B C

F

E

Page 25: EMF Compare 2.0: Scaling to Millions (updated)

Ancestor

A

G

D

B C

F

E

A

G

D

B C

F

E

A

G

D

B C

F

E

Left (local)

Right (remote)

Page 26: EMF Compare 2.0: Scaling to Millions (updated)

Ancestor

A

G

D

B C

F

E

A

G

D

B C

F

E

A

G

D

B C

F

E

Left (local)

Right (remote)

Page 27: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

To be Loaded

To be Unloaded

Already browsed

Loading ThreadUnloading Thread

Page 28: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 29: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 30: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 31: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 32: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

B G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 33: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

B G

A

A

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 34: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

B G

A

A

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 35: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G

A

A

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 36: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G

A

A

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 37: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G

A

A

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 38: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G C

A

A

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 39: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G C

A B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 40: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G C

A B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 41: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G C

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 42: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G C

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 43: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G C

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 44: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

G C

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 45: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 46: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 47: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 48: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

E D

B

A B

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 49: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

E D

B C G

A B C G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 50: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

E D

B C G

A B C G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 51: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

D

G

A B C G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 52: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

D

G

A B C G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 53: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

D

G

A B C G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 54: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

D

G

A B C G

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 55: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

D F

G E

A B C G E

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 56: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

D F

G E

A B C G E

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 57: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

F

A B C G E

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 58: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

F

A B C G E

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 59: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

F

A B C G E

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 60: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

F

A B C G E

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 61: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

F

A B C G E

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 62: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A B C G E D

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 63: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A B C G E D

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 64: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A B C G E D F

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 65: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A B C G E D F

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 66: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A B C G E D F

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 67: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

F

A B C G E D F

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 68: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A B C G E D F

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 69: EMF Compare 2.0: Scaling to Millions (updated)

Multi-ThreadedConcurrent Resolve All

A B C

DE

F

G

A B C G E D F

Loading ThreadUnloading Thread

To be Loaded

To be Unloaded

Already browsed

Page 70: EMF Compare 2.0: Scaling to Millions (updated)

Why concurrent loading?

The HDD is the bottleneck, right?

Page 71: EMF Compare 2.0: Scaling to Millions (updated)

Scheduling is crucial

Between loading and unloading threads to avoid high-memory consumption (our goal)

Page 72: EMF Compare 2.0: Scaling to Millions (updated)

Left (local)

Right (remote)

Ancestor

A

G

D

B C

F

E

A

G

D

B C

F

E

A

G

D

B C

F

E

Page 73: EMF Compare 2.0: Scaling to Millions (updated)

Ancestor

A

G

D

B C

F

E

A

G

D

B C

F

E

A

G

D

B C

F

E

Left (local)

Right (remote)

Page 74: EMF Compare 2.0: Scaling to Millions (updated)

Ancestor

A

G

D

B C

F

E

A

G

D

B C

F

E

A

G

D

B C

F

E

Left (local)

Right (remote)

Page 75: EMF Compare 2.0: Scaling to Millions (updated)

Summary

Page 76: EMF Compare 2.0: Scaling to Millions (updated)

Summary

Build the graph of resources

Page 77: EMF Compare 2.0: Scaling to Millions (updated)

Summary

Build the graph of resources

Concurrent resolve all

Page 78: EMF Compare 2.0: Scaling to Millions (updated)

Summary

Build the graph of resources

Find which resources has

changed

Concurrent resolve all

Page 79: EMF Compare 2.0: Scaling to Millions (updated)

Summary

Build the graph of resources

Find which resources has

changed

Concurrent resolve all

Binary comparison of resources

Page 80: EMF Compare 2.0: Scaling to Millions (updated)

Summary

Build the graph of resources

Find which resources has

changedCompare resource

with differences

Concurrent resolve all

Binary comparison of resources

Page 81: EMF Compare 2.0: Scaling to Millions (updated)

Summary

Build the graph of resources

Find which resources has

changedCompare resource

with differences

Concurrent resolve all

Binary comparison of resources

Match, Diff, etc. without resolving

proxies

Page 82: EMF Compare 2.0: Scaling to Millions (updated)

Kill two pigs with one (angry) bird

http

://ex

trem

ehdw

allpa

pers

.com

/wp-

cont

ent/u

ploa

ds/2

012/

08/a

ngry

-bird

s-w

allpa

per-h

d-.jp

g

Page 83: EMF Compare 2.0: Scaling to Millions (updated)

Lightweight How light?

http://www.flickr.com/photos/roberts87/2646193801/

Page 84: EMF Compare 2.0: Scaling to Millions (updated)

Fast How fast?

http://www.flickr.com/photos/themonnie/2495892146/

Page 85: EMF Compare 2.0: Scaling to Millions (updated)

Sample Models The numbers (x2 in 2-ways, x3 in 3-ways)

10

100

1000

10000

Small Medium Large

Number of fragments (resources)

10K

100K

1000K

10000K

Small Medium Large

Number of EObjects

10M

100M

1000M

Small Medium Large

Disk Usage (XMI files size)

Page 86: EMF Compare 2.0: Scaling to Millions (updated)

Sample Models The numbers (x2 in 2-ways, x3 in 3-ways)

10

100

1000

10000

Small Medium Large

Number of fragments (resources)

10K

100K

1000K

10000K

Small Medium Large

Number of EObjects

10M

100M

1000M

Small Medium Large

Disk Usage (XMI files size)

The promised millions

Page 87: EMF Compare 2.0: Scaling to Millions (updated)

CPU Usage

Some changes in 1 resource

30

60

90

120

1 10 100

Tim

e (s

ec)

number of changes

Small Medium Large

Page 88: EMF Compare 2.0: Scaling to Millions (updated)

CPU Usage

1 change in some fragments

30

60

90

120

1 5 10 20

Tim

e (s

ec)

number of changed fragments

Small Medium Large

Page 89: EMF Compare 2.0: Scaling to Millions (updated)

Memory Usage

Max Heap (-Xmx512m)

0

150

300

450

600

Small Medium Large

Max

Hea

p (M

iB)

Page 91: EMF Compare 2.0: Scaling to Millions (updated)

Time distribution

0 %

25 %

50 %

75 %

100 %

SmallNominal

Large

Model Resolving Scope Narrowing MatchingDifferencing Post-Process

Page 92: EMF Compare 2.0: Scaling to Millions (updated)

Index Cross-Resources Links

http://www.flickr.com/photos/manchesterlibrary/5425247171/

Page 93: EMF Compare 2.0: Scaling to Millions (updated)

Eclipse Papyrus supporthttp://www.flickr.com/photos/manchesterlibrary/5425247171/

Page 94: EMF Compare 2.0: Scaling to Millions (updated)

Porting Eclipse Papyrus support

Page 95: EMF Compare 2.0: Scaling to Millions (updated)

A B C

DE

F

G

To be Loaded

To be Unloaded

C

Already browsed

Loading ThreadUnloading Thread

Protect the Integrity of the Model When committing, updating...

Page 96: EMF Compare 2.0: Scaling to Millions (updated)

Generic Content Based Match Engine Decently Fast

http://nn.wikipedia.org/wiki/Fil:Postcards_and_magnifying_glass.jpg

Page 97: EMF Compare 2.0: Scaling to Millions (updated)

Merge Wizard Help to Resolve Conflict

http://cdn.memegenerator.net/instances/400x/20451927.jpg

Page 98: EMF Compare 2.0: Scaling to Millions (updated)

EMF Compare 2.1 With Kepler (Eclipse 4.3), June 2013

http://www.space.com/17376-sharing-the-light-of-two-suns.html

Page 99: EMF Compare 2.0: Scaling to Millions (updated)

What you should remember

New UI

Blazing Fast and Lightweight

More to come ;)