Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Initial Explorations on Design Pattern Energy Usage (GREENS 12)
1. INITIAL EXPLORATIONS
ON DESIGN PATTERN
ENERGY USAGE
Cagri Sahin
James Clause
Lori Pollock
Furkan Cayci
Irene Lizeth Manotas Gutiérrez
Fouad Kiamilev
Kristina Winbladh
Computer and Information
Sciences Department
Electrical and Computer
Engineering Department
University of Delaware
This work was supported in part by an award from the University of Delaware Research Foundation (UDRF).
6. MOTIVATION
While this strategy has been successful, it is likely that
encouraging software developers to participate in the
process can result in more efficient applications.
Historically, software developers have left concerns
about power consumption to lower-level engineers.
Hardware
cpu, disk, etc.
Operating
systems
Compilers
9. EXPERIMENTAL DATATable I
ENERGY USAGE MEASUREMENT OBTAINED BY RUNNING THE BEFORE AND AFTER VERSIONS OF THE DESIGN PATTERNS.
Design pattern # Iterations Energy usage # Objects # Messages
Before (J) After (J) Difference (J) Difference per
iteration (J)
% Change Before After Before After
Creational
Abstract factory 500 87.78 106.69 18.91 0.0378 21.55 11 13 7 12
Builder 750 111.75 113.08 1.33 0.0018 1.19 3 6 18 32
Factory method 500 118.13 118.06 0.08 0.0002 0.07 3 3 1 2
Prototype 750 99.60 98.68 0.93 0.0012 0.93 7 7 3 9
Singleton 250 98.70 99.11 0.42 0.0017 0.42 2 2 7 12
Structural
Bridge 35 99.78 99.54 0.24 0.0070 0.24 6 11 3 6
Composite 175 97.15 102.14 4.99 0.0285 5.14 17 19 10 11
Decorator 115 13.92 113.13 99.21 0.8627 712.89 14 24 14 15
Flyweight 500 92.89 38.94 53.95 0.1079 58.08 60 6 60 60
Proxy 500 104.33 66.28 38.05 0.0761 36.47 5 2 3 6
Behavioral
Command 750 98.32 96.53 1.79 0.0024 1.82 7 7 29 29
Mediator 250 120.55 109.02 11.53 0.0461 9.56 4 5 23 26
Observer 400 61.62 99.95 38.33 0.0958 62.20 3 7 4 8
Strategy 500 115.73 115.52 0.21 0.0004 0.18 4 3 9 12
Visitor 90 104.89 97.04 7.86 0.0873 7.49 10 14 16 26
Joules of the application before and after applying each
design pattern. The fifth column, Difference, shows the
difference in total energy usage between the before and after
versions of applying the design patterns. Positive numbers
indicate that applying the design pattern increased energy
usage, and negative numbers indicate that applying the
design pattern reduced energy usage. The next column in
the table, Difference per iteration, shows the difference in
total energy usage per iteration (i.e., the difference in the
total energy usage divided by the number of iterations).
Again, positive numbers indicate that the applying the design
relatively small differences in the amounts of energy used
(e.g., the energy usage of the before and after versions of
the application for factory method differ only by 0.08 J).
The results shown in the table also support our assumption
that applying a design pattern impacts energy usage. For all
15 design patterns, we detected a difference in the amount
of energy used between the before and after versions of the
application.
E. RQ2: Impact
Our motivation for investigating the impact on energy
10. EXPERIMENTAL DATATable I
ENERGY USAGE MEASUREMENT OBTAINED BY RUNNING THE BEFORE AND AFTER VERSIONS OF THE DESIGN PATTERNS.
Design pattern # Iterations Energy usage # Objects # Messages
Before (J) After (J) Difference (J) Difference per
iteration (J)
% Change Before After Before After
Creational
Abstract factory 500 87.78 106.69 18.91 0.0378 21.55 11 13 7 12
Builder 750 111.75 113.08 1.33 0.0018 1.19 3 6 18 32
Factory method 500 118.13 118.06 0.08 0.0002 0.07 3 3 1 2
Prototype 750 99.60 98.68 0.93 0.0012 0.93 7 7 3 9
Singleton 250 98.70 99.11 0.42 0.0017 0.42 2 2 7 12
Structural
Bridge 35 99.78 99.54 0.24 0.0070 0.24 6 11 3 6
Composite 175 97.15 102.14 4.99 0.0285 5.14 17 19 10 11
Decorator 115 13.92 113.13 99.21 0.8627 712.89 14 24 14 15
Flyweight 500 92.89 38.94 53.95 0.1079 58.08 60 6 60 60
Proxy 500 104.33 66.28 38.05 0.0761 36.47 5 2 3 6
Behavioral
Command 750 98.32 96.53 1.79 0.0024 1.82 7 7 29 29
Mediator 250 120.55 109.02 11.53 0.0461 9.56 4 5 23 26
Observer 400 61.62 99.95 38.33 0.0958 62.20 3 7 4 8
Strategy 500 115.73 115.52 0.21 0.0004 0.18 4 3 9 12
Visitor 90 104.89 97.04 7.86 0.0873 7.49 10 14 16 26
Joules of the application before and after applying each
design pattern. The fifth column, Difference, shows the
difference in total energy usage between the before and after
versions of applying the design patterns. Positive numbers
indicate that applying the design pattern increased energy
usage, and negative numbers indicate that applying the
design pattern reduced energy usage. The next column in
the table, Difference per iteration, shows the difference in
total energy usage per iteration (i.e., the difference in the
total energy usage divided by the number of iterations).
Again, positive numbers indicate that the applying the design
relatively small differences in the amounts of energy used
(e.g., the energy usage of the before and after versions of
the application for factory method differ only by 0.08 J).
The results shown in the table also support our assumption
that applying a design pattern impacts energy usage. For all
15 design patterns, we detected a difference in the amount
of energy used between the before and after versions of the
application.
E. RQ2: Impact
Our motivation for investigating the impact on energy
1. Design patterns do impact energy consumption.
11. EXPERIMENTAL DATATable I
ENERGY USAGE MEASUREMENT OBTAINED BY RUNNING THE BEFORE AND AFTER VERSIONS OF THE DESIGN PATTERNS.
Design pattern # Iterations Energy usage # Objects # Messages
Before (J) After (J) Difference (J) Difference per
iteration (J)
% Change Before After Before After
Creational
Abstract factory 500 87.78 106.69 18.91 0.0378 21.55 11 13 7 12
Builder 750 111.75 113.08 1.33 0.0018 1.19 3 6 18 32
Factory method 500 118.13 118.06 0.08 0.0002 0.07 3 3 1 2
Prototype 750 99.60 98.68 0.93 0.0012 0.93 7 7 3 9
Singleton 250 98.70 99.11 0.42 0.0017 0.42 2 2 7 12
Structural
Bridge 35 99.78 99.54 0.24 0.0070 0.24 6 11 3 6
Composite 175 97.15 102.14 4.99 0.0285 5.14 17 19 10 11
Decorator 115 13.92 113.13 99.21 0.8627 712.89 14 24 14 15
Flyweight 500 92.89 38.94 53.95 0.1079 58.08 60 6 60 60
Proxy 500 104.33 66.28 38.05 0.0761 36.47 5 2 3 6
Behavioral
Command 750 98.32 96.53 1.79 0.0024 1.82 7 7 29 29
Mediator 250 120.55 109.02 11.53 0.0461 9.56 4 5 23 26
Observer 400 61.62 99.95 38.33 0.0958 62.20 3 7 4 8
Strategy 500 115.73 115.52 0.21 0.0004 0.18 4 3 9 12
Visitor 90 104.89 97.04 7.86 0.0873 7.49 10 14 16 26
Joules of the application before and after applying each
design pattern. The fifth column, Difference, shows the
difference in total energy usage between the before and after
versions of applying the design patterns. Positive numbers
indicate that applying the design pattern increased energy
usage, and negative numbers indicate that applying the
design pattern reduced energy usage. The next column in
the table, Difference per iteration, shows the difference in
total energy usage per iteration (i.e., the difference in the
total energy usage divided by the number of iterations).
Again, positive numbers indicate that the applying the design
relatively small differences in the amounts of energy used
(e.g., the energy usage of the before and after versions of
the application for factory method differ only by 0.08 J).
The results shown in the table also support our assumption
that applying a design pattern impacts energy usage. For all
15 design patterns, we detected a difference in the amount
of energy used between the before and after versions of the
application.
E. RQ2: Impact
Our motivation for investigating the impact on energy
1. Design patterns do impact energy consumption.
2. Impact within a category is inconsistent.
12. EXPERIMENTAL DATATable I
ENERGY USAGE MEASUREMENT OBTAINED BY RUNNING THE BEFORE AND AFTER VERSIONS OF THE DESIGN PATTERNS.
Design pattern # Iterations Energy usage # Objects # Messages
Before (J) After (J) Difference (J) Difference per
iteration (J)
% Change Before After Before After
Creational
Abstract factory 500 87.78 106.69 18.91 0.0378 21.55 11 13 7 12
Builder 750 111.75 113.08 1.33 0.0018 1.19 3 6 18 32
Factory method 500 118.13 118.06 0.08 0.0002 0.07 3 3 1 2
Prototype 750 99.60 98.68 0.93 0.0012 0.93 7 7 3 9
Singleton 250 98.70 99.11 0.42 0.0017 0.42 2 2 7 12
Structural
Bridge 35 99.78 99.54 0.24 0.0070 0.24 6 11 3 6
Composite 175 97.15 102.14 4.99 0.0285 5.14 17 19 10 11
Decorator 115 13.92 113.13 99.21 0.8627 712.89 14 24 14 15
Flyweight 500 92.89 38.94 53.95 0.1079 58.08 60 6 60 60
Proxy 500 104.33 66.28 38.05 0.0761 36.47 5 2 3 6
Behavioral
Command 750 98.32 96.53 1.79 0.0024 1.82 7 7 29 29
Mediator 250 120.55 109.02 11.53 0.0461 9.56 4 5 23 26
Observer 400 61.62 99.95 38.33 0.0958 62.20 3 7 4 8
Strategy 500 115.73 115.52 0.21 0.0004 0.18 4 3 9 12
Visitor 90 104.89 97.04 7.86 0.0873 7.49 10 14 16 26
Joules of the application before and after applying each
design pattern. The fifth column, Difference, shows the
difference in total energy usage between the before and after
versions of applying the design patterns. Positive numbers
indicate that applying the design pattern increased energy
usage, and negative numbers indicate that applying the
design pattern reduced energy usage. The next column in
the table, Difference per iteration, shows the difference in
total energy usage per iteration (i.e., the difference in the
total energy usage divided by the number of iterations).
Again, positive numbers indicate that the applying the design
relatively small differences in the amounts of energy used
(e.g., the energy usage of the before and after versions of
the application for factory method differ only by 0.08 J).
The results shown in the table also support our assumption
that applying a design pattern impacts energy usage. For all
15 design patterns, we detected a difference in the amount
of energy used between the before and after versions of the
application.
E. RQ2: Impact
Our motivation for investigating the impact on energy
1. Design patterns do impact energy consumption.
2. Impact within a category is inconsistent.
3. At the design level, it’s unclear how to predict the impact.