Which Programming Languages Use the Least Electricity? (2018)
161–170 of 267 posts
Re: Which Programming Languages Use the Least Electricity? (2018)
#162Earlier quoted context omitted.
I'd be very interested in seeing a few energy benchmarks not here, for example: energy to route 1B hits to a web endpoint, energy to parse a Json, energy to grab an auth token from a web request and forward to an auth server. Energy to forward 1M 1k files from the filesystem to the network, etc.
Well, I think the reason they don't do that, and focused on the benchmark game (which I think is a good solution to their problem of needing representative sample, it just comes with its own caveats), is because much of that is often handled by libraries (possible written in C), code in the Interpreter or VM (also possibly written in C), or handled by the OS (in the case of connection handling and file access). Those…
Re: Which Programming Languages Use the Least Electricity? (2018)
#163No mention of assembly language, which should be even lower on electricity and RAM usage than C and Pascal.
Yes, I was looking for "carefully optimised Asm" on that list too. Even if it's not faster it will pretty much always be smaller. (Compilers are surprisingly easy to beat at size optimisation.)
Re: Which Programming Languages Use the Least Electricity? (2018)
#164Earlier quoted context omitted.
They already do, in the sense that you'll need beefier/more machines to do the same job. Of course, using Python means you have a lot of low-hanging fruit to pick. We have a Python service where we moved ONE ~60 line recursive function to Go and overall CPU consumption dropped to 15-20% of what it used to be.
That sounds pretty damn nice - would you happen to have a good link in mind for reading more on the subject?
Re: Which Programming Languages Use the Least Electricity? (2018)
#165IMHO it's not quite right to evaluate energy efficiency just by looking at the runtime performance. Compiled (incl. JIT) programs have to be compiled. So for compiled programs, you have upfront costs (e.g. rust, haskell much more than c), you would have to include in the calculation. Then you have programs/script that run once (a day maybe). I wouldn't be surprised if taking this into account would change the calculation.
Re: Which Programming Languages Use the Least Electricity? (2018)
#166Earlier quoted context omitted.
BEAM has a 'busy wait' feature. Schedulers with no jobs to do will remain active so they can respond to new jobs faster. You can turn this down so that the schedulers go to sleep quicker, reducing CPU usage. From http://erlang.org/doc/man/erl.html : +sbwt none|very_short|short|medium|long|very_long Sets scheduler busy wait threshold. Defaults to medium. The threshold determines how long schedulers are to busy wait wh…
Interesting. Have you ever used Erlang in production? How did you find it?
Re: Which Programming Languages Use the Least Electricity? (2018)
#167Couple points (I've worked on app servers): 1- This is exactly how we should all be thinking about server engineering moving forward, as we aim to drastically reduce carbon footprint within 11 years. Efficiencies at the language level are one of biggest bangs for buck here. Just by redeploying, you can reduce energy consumption by perhaps double digits. Imagine how hard that is to do at the hardware or energy farm le…
Go's GC is not really pushing the envelope. They have merely improved from a STW, non-compacting, non-generational collector with a 25% CPU overhead to a concurrent, non-compacting collector with reasonable overhead. JVMs and CLR had those a decade ago. The state of the art are concurrent, compacting, region-based pauseless or millisecond-pause collectors.
I'm sure you're also aware that recent Go's GC pauses are sub millisecond for most use cases:
"We now have an objective of 500 microseconds stop the world pause per GC cycle." - 2018 Go team
https://blog.golang.org/ismmkeynote
My personal experience with microservices is to expect STW pauses in the 350 microsecond range. The best part is that it requires zero tunning or developer's attention while still being light on memory usage. Can't say the same for Java's default GC.
Re: Which Programming Languages Use the Least Electricity? (2018)
#168Now, seriously: C and the boogieman of managing your own memory is a myth. Anything you want from another language can be built up from C, and be in your direct source code control working in C. Far too much propaganda is written telling programmers perfectly capable of the gains from working in C that they should be afraid of working with their own memory allocations. As if being organized is impossible.