A Decision Tree-based Approach to Dynamic Pointcut Evaluation - - PowerPoint PPT Presentation
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
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
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
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
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
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
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
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
Overview Problem Our Approach Evaluation Summary Terminology PCD Evaluation Robert Dyer and Hridesh Rajan 9 Decision Tree-based Dynamic PCD Evaluation
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
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
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
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
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
Overview Problem Our Approach Evaluation Summary Overview Partial Evaluation of Types Robert Dyer and Hridesh Rajan 15 Decision Tree-based Dynamic PCD Evaluation
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
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
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
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
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
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
Overview Problem Our Approach Evaluation Summary Robert Dyer and Hridesh Rajan 39 Decision Tree-based Dynamic PCD Evaluation
Old matching code - (∼40µs constant)
Old matching code - average case 3-50x slower worst case 3-88x slower
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
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
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
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
- C. run
- C1. run
- C2. run
- C3. run