Skip to content

Add blog post “sustainable scala” #1310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

julienrf
Copy link
Contributor

May I ask a review? 🙏

Screenshot 2021-12-13 at 16-27-32 Sustainable Scala

Copy link
Member

@SethTisue SethTisue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was really interesting reading.

One thing I'm wondering is:

I assume that in general, the longer a program takes to run, the more energy it's consuming. You write:

They compared the execution time, energy consumption, and memory consumption [...]

Did they ever find that execution time and energy consumption didn't simply vary in tandem? If so, then: in what way, under what circumstances?

Anyway, this is just something I was personally curious about. If you think other readers might be curious about it as well, you might consider answering it in the post itself.

@julienrf
Copy link
Contributor Author

Did they ever find that execution time and energy consumption didn't simply vary in tandem? If so, then: in what way, under what circumstances?

The energy consumption is proportional to the execution time: Energy (J) = Time (s) × Power (W). However, it seems (based on the measurements) that the power is not constant, so the assumption “the faster, the greener” may be too simplistic, although it is often true.

@joroKr21
Copy link
Member

I assume that in general, the longer a program takes to run, the more energy it's consuming. You write:

I think in benchmarks this might be true, but not necessarily in real world code. Think about async vs blocking database access. The async one might actually take a bit longer, but it consumes less resources (not blocking a thread) and intuitively it should also spend less energy per transaction.

Copy link
Contributor

@vincenzobaz vincenzobaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great article!

@julienrf julienrf marked this pull request as ready for review December 14, 2021 13:45
@julienrf julienrf force-pushed the blog/sustainable-scala branch from 30bc167 to 5f1f267 Compare December 14, 2021 13:48
@julienrf julienrf merged commit 60ab591 into scala:main Dec 14, 2021
@julienrf julienrf deleted the blog/sustainable-scala branch December 14, 2021 13:51
@SethTisue
Copy link
Member

SethTisue commented Dec 15, 2021

I put this up on Reddit at https://www.reddit.com/r/scala/comments/rgj6i1/sustainable_scala_blog_post_by_julien_richardfoy/ (hehe, the post title includes Wojciech, but only Julien made it into the URL)

@julienrf I assume scala_lang will tweet it out...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants