Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Haskell in Green Land: Analyzing the Energy Behavior of a Purely Functional Language

153 views

Published on

Presentation @ SANER'16

Published in: Software
  • Be the first to comment

  • Be the first to like this

Haskell in Green Land: Analyzing the Energy Behavior of a Purely Functional Language

  1. 1. Haskell in Green Land: Analyzing the Energy Behavior of a Purely Functional Language Luís Gabriel Lima1, Gilberto Melfe2, Francisco Soares-Neto1, Paulo Lieuthier1, João Paulo Fernandes2, and Fernando Castor1 1 {lgnfl, fmssn, pvjl, castor}@cin.ufpe.br 2 gilbertomelfe@gmail.com, jpf@di.ubi.pt 1
  2. 2. Global energy system is unsustainable 2
  3. 3. 3
  4. 4. 4
  5. 5. Haskell has feelings too! 5
  6. 6. rq 6 Can we save energy by refactoring Haskell programs to use different data structure implementations or concurrent programming constructs?
  7. 7. Experimental Setup 2x10-core Intel Xeon E5-2660 v2 processors(Ivy Bridge) 256GB of DDR3 1600MHz RAM Criterion RAPL 7
  8. 8. Study 1: Purely functional data structures 8
  9. 9. RQ1. How do different implementations of the same abstractions compare in terms of run time and energy efficiency? 9
  10. 10. RQ2. For concrete operations, what is the relationship between their performance and energy consumption? 10
  11. 11. Study 1: Edison Library Collections Associative Collections Sequences EnumSet StandardSet UnbalancedSet LazyPairingHeap LeftistHeap MinHeap SkewHeap SplayHeap AssocList PatriciaLoMap StandardMap TernaryTrie BankersQueue SimpleQueue BinaryRandList JoinList RandList BraunSeq FingerSeq ListSeq RevSeq SizedSeq MyersStack 11
  12. 12. Study 1: Benchmark iters operation base aux 1 1000 1 1000 5000 1 10000 10 5000 10 add addAll clear contains containsAll iterator remove removeAll toArray retainAll 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 1000 n.a. 1 1000 n.a. 1 1000 n.a. 1000 12
  13. 13. 13 iters = 0; while iters < 10 retainAll base aux; iters++;
  14. 14. 640 configurations 6000+ executions 14
  15. 15. Study 2: Results 15 http://green-haskell.github.io
  16. 16. Study 1: Results 16
  17. 17. Study 1: Findings 17 RQ1. How do different implementations of the same abstractions compare in terms of runtime and energy efficiency? RQ2. For concrete operations, what is the relationship between their performance and their energy consumption? Energy is proportional to execution time. Full details on green-haskell.github.io.
  18. 18. Study 2: Concurrent programming constructs 18
  19. 19. 19 RQ1. Do alternative thread management constructs have different impacts on energy consumption?
  20. 20. 20 RQ2. Do alternative data-sharing primitives have different impacts on energy consumption?
  21. 21. Study 2: Concurrency Primitives Thread management: forkIO, forkOn, forkOS 22
  22. 22. Study 2: Concurrency Primitives Data sharing: MVar, TVar, TMVar 23
  23. 23. 9 benchmarks: IO, memory, synchronization bound Up to 9 variants per benchmark 9 configurations for # of processors 24
  24. 24. Study 2: Results 25 http://green-haskell.github.io
  25. 25. 26 Small changes can produce big savings
  26. 26. Faster is not always greener 27
  27. 27. 28 There is no overall winner
  28. 28. 29
  29. 29. Made two tools energy-aware: Haskell profiler Criterion 31
  30. 30. fsklsdfnjdsfjsadfhjksdhflkjsdhflkjsah 32
  31. 31. fsklsdfnjdsfjsadfhjksdhflkjsdhflkjsah 33 Population: 56483 (2013) Haskell programmers: 0 (est.)
  32. 32. 34 http://green-haskell.github.io
  33. 33. 35 http://green-haskell.github.io
  34. 34. 36 http://green-haskell.github.io
  35. 35. 37 http://green-haskell.github.io

×