Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Efficiency Paradox and How to Save Yourself...

The Efficiency Paradox and How to Save Yourself and the World

Inefficiency is ruining our planet and our lives. Efficiency is ruining our happiness, and weirdly, it’s also ruining our efficiency. Heeeeelppp!? What’s a techie to do? Zombie servers and slow code are a big climate problem, but the vrrrooom model gives us double-win hope. Holly walks through a range of techniques that can be used to find and eliminate software waste and reduce climate impacts.

But machine efficiency isn’t much use without human efficiency. Surprisingly, sorting out machine efficiency often helps humans, too. For example, the Quarkus Java framework uses many interesting waste-reduction techniques. These optimisations have the dual benefit of speeding up computers, and also speeding up people.

So far, so good, but we need to be careful we don’t end up accidentally optimising the wrong things, and making stuff worse. 100% utilisation is not sustainable for either humans, or people. It’s not even very efficient (what!?). Holly gives a brief tour of the brain’s default mode network, the latest business research, and queueing theory, to show why we actually achieve more when we do a bit less.

Holly Cummins

October 02, 2024
Tweet

More Decks by Holly Cummins

Other Decks in Programming

Transcript

  1. The Efficiency Paradox and How to Save Yourself and the

    World Holly Cummins GOTO Copenhagen
  2. @holly_cummins #RedHat now senior principal software engineer helping to build

    Quarkus 2007 let’s make garbage collection more efficient!
  3. @holly_cummins #RedHat now senior principal software engineer helping to build

    Quarkus 2007 let’s make garbage collection more efficient! 2015 lean and xp makes your team more efficient!
  4. @holly_cummins #RedHat now senior principal software engineer helping to build

    Quarkus 2007 let’s make garbage collection more efficient! 2015 lean and xp makes your team more efficient! 2022 quarkus is wonderfully efficient!
  5. @holly_cummins #RedHat what we sold “this provisioning software is broken”

    10 minute provision-time 3 month provision- time what the client thought they’d got
  6. @holly_cummins #RedHat what we sold “this provisioning software is broken”

    10 minute provision-time 3 month provision- time what the client thought they’d got the reason 84-step pre-approval process
  7. @holly_cummins #RedHat https://blog.linkedin.com/2017/august/3/making-linkedin-more-accessible-via-linkedin-lite modern web is so inefficient it is

    useless for part of its audience “my heart sank … our new feature failed to load because of poor internet connectivity”
  8. #RedHat @[email protected] 25% of 16,000 servers doing no useful work

    https://www.anthesisgroup.com/wp-content/uploads/2019/11/Comatose-Servers-Redux-2017.pdf zombie servers
  9. #RedHat @[email protected] the average server: 12 - 18% of capacity

    https://www.nrdc.org/sites/default/files/data-center-efficiency-assessment-IB.pdf
  10. #RedHat @[email protected] 68% of data is stored and never used

    https://www.nrdc.org/sites/default/files/data-center-efficiency-assessment-IB.pdf https://www.seagate.com/gb/en/news/news-archive/seagates-rethink-data-report-reveals-that-68-percent-of-data-available-to-businesses-goes-unleveraged-pr-master/
  11. @holly_cummins #RedHat making turning servers off as safe and easy

    as turning lights off. and then automate it.
  12. @holly_cummins #RedHat solution: LightSwitchOps making turning servers off as safe

    and easy as turning lights off. and then automate it.
  13. @holly_cummins #RedHat absurdly simple scripts my shell script to power

    down machines overnight saved my school €12,000
  14. @holly_cummins #RedHat simple automation we used to leave our applications

    running all the time @darkandnerdy, Chicago DevOpsDays
  15. @holly_cummins #RedHat simple automation we used to leave our applications

    running all the time when we scripted turning them off at night, we reduced our cloud bill by 30% @darkandnerdy, Chicago DevOpsDays
  16. @holly_cummins #RedHat Energy 1 10 100 Time 1 10 100

    energy efficiency across programming languages Python Rust Java Go
  17. @holly_cummins #RedHat Energy 1 10 100 Time 1 10 100

    the trend line is more or less straight energy efficiency across programming languages Python Rust Java Go
  18. @holly_cummins Java dynamism </> build time runtime load and parse

    • config files • properties • yaml • xml • etc.
  19. @holly_cummins Java dynamism @ @ </> build time runtime •

    classpath scanning and annotation discovery • attempt to load class to enable/disable features
  20. @holly_cummins what if we start the application more than once?

    @ @ </> @ @ </> @ @ </> @ @ </> so much work gets redone every time
  21. @holly_cummins unused implementation the one we want interface unused implementation

    unused implementation the true cost of loaded classes isn’t just memory + start time method dispatching:
  22. @holly_cummins unused implementation the one we want interface unused implementation

    unused implementation the true cost of loaded classes isn’t just memory + start time method dispatching:
  23. @holly_cummins unused implementation the one we want interface megamorphic call

    slow dispatching unused implementation unused implementation the true cost of loaded classes isn’t just memory + start time method dispatching:
  24. @holly_cummins the true cost of loaded classes isn’t just memory

    + start time the one we want monomorphic call fast dispatching interface
  25. @holly_cummins @ @ </> build time runtime start • thread

    pools • I/O • etc. what if we initialize at build time?
  26. @holly_cummins @ @ </> build time runtime ready to do

    work! start • thread pools • I/O • etc. what if we initialize at build time?
  27. @holly_cummins #RedHat Setup: • REST + CRUD • large heap

    • RAPL energy measurement • multiple instances to support high load
 Assumptions: • US energy mix Source: John O’Hara effect on energy consumption (RAPL measurements)
  28. @holly_cummins #RedHat Setup: • REST + CRUD • large heap

    • RAPL energy measurement • multiple instances to support high load
 Assumptions: • US energy mix Source: John O’Hara effect on energy consumption (RAPL measurements) vrrooom model in action quarkus on JVM has the lowest carbon … because it has the highest throughput
  29. @holly_cummins #RedHat package com.example; import org.jboss.logging.Logger; public class Thing {

    private static final Logger log = Logger.getLogger(Thing.class); public void doSomething() { log.info("It works!"); } } example: logging
  30. @holly_cummins #RedHat package com.example; import org.jboss.logging.Logger; public class Thing {

    private static final Logger log = Logger.getLogger(Thing.class); public void doSomething() { log.info("It works!"); } } example: logging import io.quarkus.logging.Log; Log
  31. @holly_cummins #RedHat @ApplicationScoped public class GreetingRepository { public Entity findByName(int

    name) { return find("name", name).firstResult(); } void persist(Entity entity) {} void delete(Entity entity) {} Entity findById(Id id) {} List<Entity> list(String query, Sort sort, Object... params) { return null; } Stream<Entity> stream(String query, Object... params) { return null; } long count() { return 0; } long count(String query, Object... params) { return 0; } } example: hibernate with panache
  32. @holly_cummins #RedHat @ApplicationScoped public class GreetingRepository { public Entity findByName(int

    name) { return find("name", name).firstResult(); } void persist(Entity entity) {} void delete(Entity entity) {} Entity findById(Id id) {} List<Entity> list(String query, Sort sort, Object... params) { return null; } Stream<Entity> stream(String query, Object... params) { return null; } long count() { return 0; } long count(String query, Object... params) { return 0; } } example: hibernate with panache
  33. @holly_cummins #RedHat DAO example: hibernate with panache @ApplicationScoped public class

    GreetingRepository implements PanacheRepository<Greeting> { public Entity findByName(int name) { return find("name", name).firstResult(); } }
  34. @holly_cummins #RedHat no regrets solution: we got rid of dynamism

    we didn’t even want, and made everything better
  35. @holly_cummins #RedHat “What is the world record for crossing the

    English channel entirely on foot?” https://www.sify.com/ai-analytics/the-hilarious-and-horrifying-hallucinations-of-ai/
  36. @holly_cummins #RedHat “What is the world record for crossing the

    English channel entirely on foot?” “The world record for crossing the English Channel entirely on foot is held by Christof Wandratsch of Germany, who completed the crossing in 14 hours and 51 minutes on August 14, 2020.” https://www.sify.com/ai-analytics/the-hilarious-and-horrifying-hallucinations-of-ai/
  37. @holly_cummins #RedHat even for machines, there is a limit to

    efficiency …and it’s lower than you think limit 2
  38. @holly_cummins #RedHat theoretical max efficiency of a combustion engine: 37%

    … so the engine doesn’t wear out: ~20% limit 2
  39. @holly_cummins #RedHat highly efficient (optimum number of legs) no resiliency

    less efficient (more legs than needed) resilient #RedHat
  40. @holly_cummins #RedHat highly efficient (optimum number of legs) no resiliency

    less efficient (more legs than needed) resilient #RedHat resiliency lowers efficiency
  41. @holly_cummins #RedHat “Your brain at positive is 31% more productive

    than your brain at negative, neutral or stressed. " https:/ /hbr.org/2012/01/positive-intelligence
  42. @holly_cummins #RedHat "Individuals [who just watched a comedy video] have

    approximately 12% greater productivity." https:/ /wrap.warwick.ac.uk/63228/7/WRAP_Oswald_681096.pdf
  43. @holly_cummins #RedHat queueing theory says systems need to run under-capacity

    to function psychology says we need idle time; maths agrees
  44. @holly_cummins #RedHat if arrival rates are low, servers will be

    idle queue arrival process servers completed work
  45. @holly_cummins #RedHat utilisation http://brodzinski.com/2015/01/slack-time-value.html cost delay cost cost of idle

    capacity assuming Poisson distribution of arrivals 80% utilisation → 90% utilisation: wait times double
  46. @holly_cummins #RedHat cool and bouncy most efficient land animal uncool

    and floppy whole body is basically slack most efficient animal
  47. @holly_cummins the trade-off isn’t what we think it is being

    effective working less another double-win.
  48. @holly_cummins #RedHat tl;dpa ⁃ don’t accept waste; our world deserves

    better ⁃ work less; achieve more (too long; didn’t pay attention)
  49. @holly_cummins #RedHat tl;dpa ⁃ don’t accept waste; our world deserves

    better ⁃ work less; achieve more ⁃ happiness is not waste (too long; didn’t pay attention)
  50. @holly_cummins #RedHat tl;dpa ⁃ don’t accept waste; our world deserves

    better ⁃ work less; achieve more ⁃ happiness is not waste ⁃ idleness is not waste (too long; didn’t pay attention)
  51. @holly_cummins #RedHat tl;dpa ⁃ don’t accept waste; our world deserves

    better ⁃ work less; achieve more ⁃ happiness is not waste ⁃ idleness is not waste ⁃ look for double-wins everywhere (too long; didn’t pay attention)
  52. Rate this session in the GOTO Guide and claim your

    reward slides https://hollycummins.com/efficiency-goto/