A Decision Tree-based Approach to Dynamic Pointcut Evaluation - - PowerPoint PPT Presentation

a decision tree based approach to dynamic pointcut
SMART_READER_LITE
LIVE PREVIEW

A Decision Tree-based Approach to Dynamic Pointcut Evaluation - - PowerPoint PPT Presentation

A Decision Tree-based Approach to Dynamic Pointcut Evaluation Robert Dyer and Hridesh Rajan Department of Computer Science Iowa State University { rdyer,hridesh } @cs.iastate.edu October 19, 2008 Overview Problem Our Approach Evaluation


slide-1
SLIDE 1

A Decision Tree-based Approach to Dynamic Pointcut Evaluation

Robert Dyer and Hridesh Rajan

Department of Computer Science Iowa State University {rdyer,hridesh}@cs.iastate.edu

October 19, 2008

slide-2
SLIDE 2

Overview Problem Our Approach Evaluation Summary

◮ Motivation: Dynamic PCD Evaluation ◮ Approach: Decision-tree based Matching ◮ Technical Contributions:

◮ Formalization of the PCD Evaluation problem ◮ Algorithms using Decision-tree structures for faster

matching

◮ Use of implication relationships for partial evaluation of type

predicates

Robert Dyer and Hridesh Rajan 2 Decision Tree-based Dynamic PCD Evaluation

slide-3
SLIDE 3

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

a ∈ A, the set of attributes

O, the set of operators v ∈ V, the set of values

Robert Dyer and Hridesh Rajan 3 Decision Tree-based Dynamic PCD Evaluation

slide-4
SLIDE 4

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

a ∈ A, the set of attributes

O, the set of operators v ∈ V, the set of values pred ::= ( a , o , v ) fact ::= ( a , v )

Robert Dyer and Hridesh Rajan 4 Decision Tree-based Dynamic PCD Evaluation

slide-5
SLIDE 5

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

a ∈ A, the set of attributes

O, the set of operators v ∈ V, the set of values pred ::= ( a , o , v ) fact ::= ( a , v ) PCD ::= pred | ( PCD ) | pred && PCD | pred || PCD join point ::= fact | fact && join point

Robert Dyer and Hridesh Rajan 5 Decision Tree-based Dynamic PCD Evaluation

slide-6
SLIDE 6

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

A ::= {modifier, type, name} V ::= {v : v is a modifier, type or name in the program} O ::= {==, !=}

Robert Dyer and Hridesh Rajan 6 Decision Tree-based Dynamic PCD Evaluation

slide-7
SLIDE 7

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

A ::= {modifier, type, name} V ::= {v : v is a modifier, type or name in the program} O ::= {==, !=} Example PCD (modifier, ==, public) && (type, !=, void) && (name, ==, "Set")

Robert Dyer and Hridesh Rajan 7 Decision Tree-based Dynamic PCD Evaluation

slide-8
SLIDE 8

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

A ::= {modifier, type, name} V ::= {v : v is a modifier, type or name in the program} O ::= {==, !=} Example PCD (modifier, ==, public) && (type, !=, void) && (name, ==, "Set") Example join point (modifier, public) && (type, FElement) && (name, "Set")

Robert Dyer and Hridesh Rajan 8 Decision Tree-based Dynamic PCD Evaluation

slide-9
SLIDE 9

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation Robert Dyer and Hridesh Rajan 9 Decision Tree-based Dynamic PCD Evaluation

slide-10
SLIDE 10

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

◮ 2 ways of viewing the problem

◮ PCDEval’ Robert Dyer and Hridesh Rajan 10 Decision Tree-based Dynamic PCD Evaluation

slide-11
SLIDE 11

Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation

◮ 2 ways of viewing the problem

◮ PCDEval Robert Dyer and Hridesh Rajan 11 Decision Tree-based Dynamic PCD Evaluation

slide-12
SLIDE 12

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

◮ Evaluation Algorithm overview

◮ Order predicates for efficiency ◮ Create PCD evaluation tree(s) ◮ Add predicates to decision trees ◮ Create links to parents Robert Dyer and Hridesh Rajan 12 Decision Tree-based Dynamic PCD Evaluation

slide-13
SLIDE 13

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

Consider the following PCD: Pred1(Pred2&&Pred3)

Robert Dyer and Hridesh Rajan 13 Decision Tree-based Dynamic PCD Evaluation

slide-14
SLIDE 14

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

◮ Order predicates for efficiency

◮ Modifiers are simple to match ◮ Makes other decision-trees disjoint (smaller) Robert Dyer and Hridesh Rajan 14 Decision Tree-based Dynamic PCD Evaluation

slide-15
SLIDE 15

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types Robert Dyer and Hridesh Rajan 15 Decision Tree-based Dynamic PCD Evaluation

slide-16
SLIDE 16
slide-17
SLIDE 17
slide-18
SLIDE 18
slide-19
SLIDE 19
slide-20
SLIDE 20
slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23
slide-24
SLIDE 24
slide-25
SLIDE 25
slide-26
SLIDE 26
slide-27
SLIDE 27
slide-28
SLIDE 28
slide-29
SLIDE 29
slide-30
SLIDE 30
slide-31
SLIDE 31
slide-32
SLIDE 32
slide-33
SLIDE 33

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

◮ Goal: Reduce size of decision-trees ◮ Idea: Partially evaluate predicates

Robert Dyer and Hridesh Rajan 33 Decision Tree-based Dynamic PCD Evaluation

slide-34
SLIDE 34

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

◮ Known: B ⋖ C ◮ Evaluate: A ⋖ B, A ⋖ C

Robert Dyer and Hridesh Rajan 34 Decision Tree-based Dynamic PCD Evaluation

slide-35
SLIDE 35

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

◮ Known: B ⋖ C ◮ Evaluate: A ⋖ B, A ⋖ C ◮ A ⋖ B ∧ B ⋖ C

Robert Dyer and Hridesh Rajan 35 Decision Tree-based Dynamic PCD Evaluation

slide-36
SLIDE 36

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

◮ Known: B ⋖ C ◮ Evaluate: A ⋖ B, A ⋖ C ◮ A ⋖ B ∧ B ⋖ C → A ⋖ C

Robert Dyer and Hridesh Rajan 36 Decision Tree-based Dynamic PCD Evaluation

slide-37
SLIDE 37

Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types

◮ Known: B ⋖ C ◮ Evaluate: A ⋖ B, A ⋖ C ◮ A ⋖ B ∧ B ⋖ C → A ⋖ C ◮ Partially Evaluate: A ⋖ B

Robert Dyer and Hridesh Rajan 37 Decision Tree-based Dynamic PCD Evaluation

slide-38
SLIDE 38

Overview Problem Our Approach Evaluation Summary

◮ Created implementation in Nu virtual machine ◮ Bind and Remove primitives for deploying/un-deploying

advice

◮ Synthetic micro-benchmark

◮ Measures time to Bind (add to trees) and match ◮ Varies type hierarchy depth Robert Dyer and Hridesh Rajan 38 Decision Tree-based Dynamic PCD Evaluation

slide-39
SLIDE 39

Overview Problem Our Approach Evaluation Summary Robert Dyer and Hridesh Rajan 39 Decision Tree-based Dynamic PCD Evaluation

slide-40
SLIDE 40

Old matching code - (∼40µs constant)

slide-41
SLIDE 41

Old matching code - average case 3-50x slower worst case 3-88x slower

slide-42
SLIDE 42

Overview Problem Our Approach Evaluation Summary

Related Work

◮ Efficient Matching Techniques ◮ Dynamic Residue Evaluation ◮ Partial Evaluation Techniques

Robert Dyer and Hridesh Rajan 42 Decision Tree-based Dynamic PCD Evaluation

slide-43
SLIDE 43

Overview Problem Our Approach Evaluation Summary

Future Work

◮ Example Implementation(s) ◮ Real-world Evaluations

Robert Dyer and Hridesh Rajan 43 Decision Tree-based Dynamic PCD Evaluation

slide-44
SLIDE 44

Overview Problem Our Approach Evaluation Summary

◮ Motivation: Dynamic PCD Evaluation

◮ PCDs arrive dynamically ◮ PCDs might be removed later ◮ Matching the whole (loaded) system against a PCD is too

slow

◮ Approach: Decision-tree based Matching

◮ Order evaluations based on cost ◮ Partially evaluate wherever possible

◮ Technical Contributions:

◮ Formalization of the PCD Evaluation problem ◮ Algorithms using Decision-tree structures for faster

matching

◮ Use of implication relationships for partial evaluation of type

predicates

Robert Dyer and Hridesh Rajan 44 Decision Tree-based Dynamic PCD Evaluation

slide-45
SLIDE 45

Overview Problem Our Approach Evaluation Summary

Questions?

http://www.cs.iastate.edu/˜nu/

Robert Dyer and Hridesh Rajan 45 Decision Tree-based Dynamic PCD Evaluation

slide-46
SLIDE 46
slide-47
SLIDE 47
  • C. run
  • C1. run
  • C2. run
  • C3. run

. . class C { public s t a t i c void run ( ) { measure { Bind . . / / to methods returning C1 } measure { Bind . . / / to methods returning C2 } measure { Bind . . / / to methods returning C3 } measure { C1. testMethod } measure { C2. testMethod } measure { C3. testMethod } } public C testMethod ( ) { return NULL } }