Title: On the Object Orientedness of C programs in SPEC CPU 2006
1On the Object Orientedness of C programs in
SPEC CPU 2006
- Ciji Isen Lizy K. John
- University of Texas - Austin
1/27/2008
2Introduction
- Object Oriented programming encourages
- Code modularity, ease of design maintenance
- Inheritance hierarchies
- polymorphism
- Dynamic Dispatch
- Should imply
- Multiple function invocation
- More functions
- More indirect branching
- Increased control flow
- particularly function calls and indirect branches
3Objective
- Object oriented nature of SPEC CPU2006 C
programs - Measure using quantifiable metrics
- Compare with other OO(SPEC java) benchmarks
- Has OO nature affected control flow?
- branch compositions
- Branch misprediction
4C programs in SPEC cpu06
5Methodology
- Performance counters
- Woodcrest(Intel), Power5(IBM)
- Benchmarks
- SPEC CPU 2006
- SPEC jbb2000
- SPECjvm98
- Principle Component Analysis for Visualization
6Object Oriented metrics
- CK (Chidamber and Kemerrer) metrics
- WMC (Weighted Methods per Class)
- DIT (Depth of Inheritance Tree)
- NOC (Number of Children)
- CBO (Coupling Between Objects)
- RFC (Response for a Class)
7WMC (Weighted Methods per Class)
- if complexity is unity
- WMC n
- Intuition More methods implies
- more time effort to develop and maintain class
- More methods inherited by children gt more impact
on children - Likely to be more application specific gt less
reuse
8DIT (Depth of Inheritance Tree)
- A measure of impact of ancestor classes
- Intuition deeper class hierarchy implies
- More methods inherited gt more complexity
- Greater design complexity
- Greater potential to reuse inherited methods
9NOC (Number of Children)
- Definition Number of immediate subclasses
- Intuition more children implies
- Greater reuse
- more influence on the design
10CBO (Coupling Between Objects)
- Definition The number of other classes to which
a class is coupled - Via methods
- Instance variables
- Intuition more coupling implies
- Bad for modularity. Less independence for class
gt difficult to reuse - Less independence gt sensitive to change in other
parts - More interaction gt complexity in testing
correctness
11RFC (Response for a Class)
- Intuition more methods executed per message
implies - More complexity for the class
- Complexity in testing and debugging
12Object Orientedness of C benchmarks in cpu06
13Object Orientedness of C benchmarks in cpu06
14Object Orientedness of C vs. java benchmarks
DaCapo paper
15Object Orientedness of C vs. java benchmarks
16Control flow Characteristics
- Has OO nature affected control flow?
- branch compositions
- Branch misprediction
17Branch types - INT
18Branch types - FP
19Branch types - INT
20Branch types - FP
21Branch misprediction - INT
22Branch misprediction - FP
23Summary
- Increased presence of C in SPEC CPU encouraging
- Measured object orientedness of C programs
- Xalanckbmk,dealII omnetpp strong OO
- OO nature of C programs not any worse than SPEC
Java benchmarks - Analyzed impact of OO nature on control flow
- Control flow increase pronounced for FP
- Xalanckbmk, dealII omnetpp higher of
function calls and indirect branches
24Questions
24
Laboratory for Computer Architecture
8/28/2007