On Haskell and energy efficiency

Luís Gabriel Lima, Francisco Soares-Neto, Paulo Lieuthier, Fernando Castor, Gilberto Melfe, João Paulo Fernandes

Research output: Contribution to journalArticlepeer-review


Background: Recent work has studied diverse affecting factors on software energy efficiency. Objective: This paper attempts to shed light on the energy behavior of programs written in a lazy, purely functional programming language, Haskell. Methodology: We conducted two in-depth and complementary studies to analyze the energy efficiency of programs from two different perspectives: strictness and concurrency. Results: We found that small changes can make a big difference. In one benchmark, under a specific configuration, choosing the MVar data sharing primitive over TMVar can yield 60% energy savings. In another benchmark, TMVar can yield up to 30% savings over MVar. Thus, tools that support developers in refactoring a program to switch between primitives can be very useful. In addition, the relationship between energy consumption and performance is not always clear. In sequential benchmarks, high performance is an accurate proxy for low energy consumption. However, for one of our concurrent benchmarks, the variants with the best performance also exhibited the worst energy consumption. We report on deviating cases. Conclusions: To support developers, we have extended existing performance analysis tools to also gather and present data about energy consumption. Furthermore, we provide a set of guidelines to help Haskell developers save energy.

Original languageEnglish (US)
Pages (from-to)554-580
Number of pages27
JournalJournal of Systems and Software
StatePublished - Mar 2019


  • Energy efficiency
  • Functional programming
  • Haskell

ASJC Scopus subject areas

  • Software
  • Information Systems
  • Hardware and Architecture


Dive into the research topics of 'On Haskell and energy efficiency'. Together they form a unique fingerprint.

Cite this