TY - GEN
T1 - Compiling Haskell for Energy Efficiency
T2 - 39th Annual ACM Symposium on Applied Computing, SAC 2024
AU - Kirkeby, Maja Hanne
AU - Santos, Bernardo
AU - Fernandes, João Paulo
AU - Pardo, Alberto
N1 - Publisher Copyright:
© 2024 Copyright is held by the owner/author(s). Publication rights licensed to ACM.
PY - 2024/4/8
Y1 - 2024/4/8
N2 - Energy efficiency is a growing concern for software developers. This empirical study investigates the impact of compiler optimizations on energy efficiency in Haskell programs compiled using the Glasgow Haskell Compiler (GHC). We focus on GHC's -O2 optimization series and explore the effects of selectively disabling individual optimizations using -fno-∗flags, alongside variations in initial execution temperatures.We examined 25 GHC optimizations across 18 benchmarks from the NoFib Haskell Benchmark Suite resulting in 468 combinations of benchmark and optimization-deactivations. Data was collected at three starting temperatures (45°C, 55°C, and 65°C), resulting in 40 samples per benchmark-optimization combination. Our key metrics included energy consumption and execution time.Considering all combinations, for 24% of the individual optimizations provided, when disabled, a significant increase in energy consumption, i.e., enabling these optimizations resulted in more energy-efficient executables, whereas for 26% the optimization provided a significant increase in time, when disabled. However, only for 12% of all the combinations, the disabling increased both time and energy consumption significantly, and in 5% of all the combinations, we observed opposite impacts on time and energy.We found that 10 optimizations produced equally or more energy-efficient executables for all the benchmarks, whereas only one compiler optimization produced a better or equally performing executable for all the benchmarks.As a secondary finding, we explored the influence of initial temperatures on energy consumption. While programs that started at 45°C showed the least variance in terms of both energy consumption and wall time, those started at 55°C tended to exhibit lower energy consumption for the typical program compared to those started at 45°C or 65°C.
AB - Energy efficiency is a growing concern for software developers. This empirical study investigates the impact of compiler optimizations on energy efficiency in Haskell programs compiled using the Glasgow Haskell Compiler (GHC). We focus on GHC's -O2 optimization series and explore the effects of selectively disabling individual optimizations using -fno-∗flags, alongside variations in initial execution temperatures.We examined 25 GHC optimizations across 18 benchmarks from the NoFib Haskell Benchmark Suite resulting in 468 combinations of benchmark and optimization-deactivations. Data was collected at three starting temperatures (45°C, 55°C, and 65°C), resulting in 40 samples per benchmark-optimization combination. Our key metrics included energy consumption and execution time.Considering all combinations, for 24% of the individual optimizations provided, when disabled, a significant increase in energy consumption, i.e., enabling these optimizations resulted in more energy-efficient executables, whereas for 26% the optimization provided a significant increase in time, when disabled. However, only for 12% of all the combinations, the disabling increased both time and energy consumption significantly, and in 5% of all the combinations, we observed opposite impacts on time and energy.We found that 10 optimizations produced equally or more energy-efficient executables for all the benchmarks, whereas only one compiler optimization produced a better or equally performing executable for all the benchmarks.As a secondary finding, we explored the influence of initial temperatures on energy consumption. While programs that started at 45°C showed the least variance in terms of both energy consumption and wall time, those started at 55°C tended to exhibit lower energy consumption for the typical program compared to those started at 45°C or 65°C.
KW - compiler optimizations
KW - energy consumption
KW - functional programming
KW - program transformations
KW - programming languages
UR - http://www.scopus.com/inward/record.url?scp=85197726185&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85197726185&partnerID=8YFLogxK
U2 - 10.1145/3605098.3635915
DO - 10.1145/3605098.3635915
M3 - Conference contribution
AN - SCOPUS:85197726185
T3 - Proceedings of the ACM Symposium on Applied Computing
SP - 1104
EP - 1113
BT - 39th Annual ACM Symposium on Applied Computing, SAC 2024
PB - Association for Computing Machinery
Y2 - 8 April 2024 through 12 April 2024
ER -