Compiling Haskell for Energy Efficiency: Empirical Analysis of Individual Transformations

Maja Hanne Kirkeby, Bernardo Santos, João Paulo Fernandes, Alberto Pardo

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

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.

Original languageEnglish (US)
Title of host publication39th Annual ACM Symposium on Applied Computing, SAC 2024
PublisherAssociation for Computing Machinery
Pages1104-1113
Number of pages10
ISBN (Electronic)9798400702433
DOIs
StatePublished - Apr 8 2024
Event39th Annual ACM Symposium on Applied Computing, SAC 2024 - Avila, Spain
Duration: Apr 8 2024Apr 12 2024

Publication series

NameProceedings of the ACM Symposium on Applied Computing

Conference

Conference39th Annual ACM Symposium on Applied Computing, SAC 2024
Country/TerritorySpain
CityAvila
Period4/8/244/12/24

Keywords

  • compiler optimizations
  • energy consumption
  • functional programming
  • program transformations
  • programming languages

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'Compiling Haskell for Energy Efficiency: Empirical Analysis of Individual Transformations'. Together they form a unique fingerprint.

Cite this