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

Efficiency and Rock 'n’ Roll (Really!)

Efficiency and Rock 'n’ Roll (Really!)

Is efficiency rock and roll? You might think the answer is “no, definitely not, no way.” Efficiency is about doing more with less, and rock n’ roll is all about turning it up to eleven and doing more with more. Efficiency is about being responsible, and rock n’ roll is about being irresponsible. But wait! High overheads are not rock n roll, and they’re not efficient. Spending time on boring tasks is neither rock n roll, nor efficient. We’re spending way too much time writing and running code that doesn’t spark joy. In this talk, Holly will discuss practical patterns for wringing maximum value out of our code, for minimum effort. One of the techniques is sleeping! It turns out, both people and computers should be lazier, and that’s definitely rock n roll.

Avatar for Holly Cummins

Holly Cummins

May 26, 2025
Tweet

More Decks by Holly Cummins

Other Decks in Programming

Transcript

  1. @hollycummins.com #Quarkus rock & roll a style of popular music

    played on electronically amplified instruments and characterized by a persistent heavily accented beat, repetition of simple phrases …
  2. @hollycummins.com #Quarkus what we sold “this provisioning software is broken”

    10 minute provision-time 3 month provision- time what the client thought they’d got
  3. @hollycummins.com #Quarkus 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
  4. @hollycummins.com 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” Nashik
  5. @hollycummins.com solution: LightSwitchOps • making turning servers off as safe

    and easy as turning lights off. • and then automate it.
  6. 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 simple automation
  7. @hollycummins.com #Quarkus the trend line is more or less straight

    energy efficiency across programming languages Python Rust Java Go Javascript
  8. @hollycummins.com #Quarkus java dynamism </> build time runtime load and

    parse • config files • properties • yaml • xml • etc.
  9. @hollycummins.com #Quarkus java dynamism @ @ </> build time runtime

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

    @ </> @ @ </> @ @ </> @ @ </> so much work gets redone every time
  11. @hollycummins.com 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:
  12. @hollycummins.com 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:
  13. @hollycummins.com 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:
  14. @hollycummins.com the true cost of loaded classes isn’t just memory

    + start time the one we want monomorphic call fast dispatching interface
  15. @ @ </> build time runtime ready to do work!

    what if we initialize at build time?
  16. @ @ </> build time runtime ready to do work!

    start • thread pools • I/O • etc. what if we initialize at build time?
  17. @hollycummins.com Setup: • REST + CRUD • large heap •

    RAPL energy measurement Assumptions: • US energy mix climate impact of framework choice
  18. @hollycummins.com Setup: • REST + CRUD • large heap •

    RAPL energy measurement Assumptions: • US energy mix climate impact of framework choice shorter line means lower max throughput
  19. @hollycummins.com Setup: • REST + CRUD • large heap •

    RAPL energy measurement Assumptions: • US energy mix climate impact of framework choice shorter line means lower max throughput higher line means worse carbon footprint
  20. @hollycummins.com Setup: • REST + CRUD • large heap •

    RAPL energy measurement Assumptions: • US energy mix climate impact of framework choice vrrrooom model in action: quarkus on JVM has the smallest footprint … because it has the highest throughput shorter line means lower max throughput higher line means worse carbon footprint
  21. @hollycummins.com live coding -less energy wasted running full build +

    launch cycles -less dev time wasted waiting for full build + launch cycles
  22. @hollycummins.com targeted continuous testing -less energy wasted running full test

    suites -less dev time wasted waiting for full test runs
  23. @hollycummins.com it’s detuned so the engine does not wear out

    ~20% typical efficiency of a combustion engine
  24. @hollycummins.com it’s detuned so the engine does not wear out

    ~20% typical efficiency of a combustion engine
  25. @hollycummins.com highly efficient (optimum number of legs) no resiliency less

    efficient (more legs than needed) resilient resiliency lowers efficiency
  26. @hollycummins.com queueing theory says systems need to run under-capacity to

    function psychology says we need idle time; maths agrees
  27. @hollycummins.com if arrival rates are low, servers will be idle

    queue arrival process servers completed work
  28. @hollycummins.com if server capacity is too low, wait times are

    high queue arrival process servers completed work
  29. @hollycummins.com 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
  30. @hollycummins.com the trade-off isn’t what we think it is being

    effective working less another double-win.
  31. @hollycummins.com #Quarkus “I did not know what Rockstar was before

    I went to this talk. I do not think I will use Rockstar at work.”
  32. @hollycummins.com tl;dpa ⁃ rage against waste; our world deserves better

    ⁃ work less; achieve more (too long; didn’t pay attention)
  33. @hollycummins.com tl;dpa ⁃ rage against waste; our world deserves better

    ⁃ work less; achieve more ⁃ happiness is not waste (too long; didn’t pay attention)
  34. @hollycummins.com tl;dpa ⁃ rage against waste; our world deserves better

    ⁃ work less; achieve more ⁃ happiness is not waste ⁃ idleness is not waste (too long; didn’t pay attention)
  35. @hollycummins.com tl;dpa ⁃ rage against 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)