TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Energy Efficiency Across Programming Languages

188 pointsby foobover 7 years ago

23 comments

flavio81over 7 years ago
According to their normalized &quot;global&quot; results, something interesting i see:<p>1. Pascal, surprisingly, the most memory efficient of all. I should take a look at the implementation they used.<p>2. Rust a good alternative to C which leads in &quot;energy efficiency&quot; and speed.<p>3. Common Lisp most energy-efficient <i>and</i> fastest <i>and</i> smallest memory footprint of <i>all</i> the dynamic programming languages in the list -- like Python, Ruby, Lua, Perl, and even Racket (which fares pretty well)<p>4. PHP, JRuby, Ruby, Typescript, Perl, Python, being <i>massively</i> slow than the fastest languages, for example Ruby being 59 times slower than Rust or C.<p>I agree that these languages (in item 4) are &quot;acceptably fast&quot; for many applications, but we can&#x27;t say they are &quot;close to the speed&quot; of the fastest languages, even more if we consider the fastest dynamic+interactive languages like Lisp (Python being 21 times slower than Lisp.)<p>5. I wonder which implementation of Lua they used. Lua can be pretty fast, one of the fastest dynamic languages out there.
评论 #15251570 未加载
评论 #15251225 未加载
评论 #15255702 未加载
评论 #15251806 未加载
评论 #15251998 未加载
评论 #15251965 未加载
评论 #15252336 未加载
评论 #15252860 未加载
评论 #15255427 未加载
cwzwarichover 7 years ago
I can&#x27;t believe they used the Computer Language Benchmarks Game. Those benchmarks don&#x27;t reflect real-world workloads at all, and the contest has fairly arbitrary rules about implementations and widely differing implementation quality between languages. This should have been rejected by peer review.
评论 #15254383 未加载
评论 #15254769 未加载
评论 #15251956 未加载
评论 #15252486 未加载
trhwayover 7 years ago
For a bunch of years i was writing in Java and driving V8. Now i&#x27;m back to native (C++) and am driving Prius these days. I guess that it is my eco-consciousness that is making me shudder in disgust every time i look at Python... pretty much the same way like when looking at Hummers. While of course i love Perl, an M1 Abrams which gets things done despite anything :)
mtmover 7 years ago
A real shame that Forth wasn&#x27;t included in the tested languages. Chuck Moore has been an advocate for more energy efficient computation for a while now.
评论 #15252423 未加载
评论 #15255593 未加载
评论 #15255132 未加载
winter_blueover 7 years ago
Note: The PDF of the paper has the a lot more detailed listing of the results (with graphs, explanation, etc) than the results web page: <a href="http:&#x2F;&#x2F;greenlab.di.uminho.pt&#x2F;wp-content&#x2F;uploads&#x2F;2017&#x2F;09&#x2F;paperSLE.pdf" rel="nofollow">http:&#x2F;&#x2F;greenlab.di.uminho.pt&#x2F;wp-content&#x2F;uploads&#x2F;2017&#x2F;09&#x2F;pape...</a>
评论 #15256486 未加载
phkahlerover 7 years ago
Rust is fairly competitive with C, but it&#x27;s memory use was 50 percent higher. I bet if they focus on getting the memory usage down it will perform better too.
评论 #15254044 未加载
int_19hover 7 years ago
I&#x27;m kinda surprised to see Go score so low on some of these, given that it&#x27;s AOT-compiled to native code, and that its memory model and safety guarantees are optimization-friendly.<p>I&#x27;m also kinda surprised that OCaml scored that high, considering how high-level it is.
评论 #15258445 未加载
matt_wulfeckover 7 years ago
Higher-level scripting languages. Fast for programmer&#x27;s time, slow for run times.
评论 #15255521 未加载
danieltillettover 7 years ago
On of the things with the C set is they didn&#x27;t use Intel&#x27;s icc. On our main application (which involved a lot of heavy duty number crunching) it speeds up our application by 100% over the best we can get out gcc.
评论 #15252519 未加载
gwenzekover 7 years ago
I&#x27;m suprised at the Java-C# comparaison. When are this numbers from?<p>The following blogspot explains how the author improved C# implementations after seeing defavorable C# results.<p><a href="https:&#x2F;&#x2F;anthonylloyd.github.io&#x2F;blog&#x2F;2017&#x2F;08&#x2F;15&#x2F;dotnetcore-performance" rel="nofollow">https:&#x2F;&#x2F;anthonylloyd.github.io&#x2F;blog&#x2F;2017&#x2F;08&#x2F;15&#x2F;dotnetcore-pe...</a>
stewbrewover 7 years ago
So go (a garbage collected language) is about as memory efficient as pascal, the most memory efficient language. That comes surprising.
评论 #15251936 未加载
nur0nover 7 years ago
I have just started looking into Ada and it is cool to see up there with C. Does anyone know a good resource for writing fast Ada?
goatloverover 7 years ago
No Julia?
kcarnoldover 7 years ago
I see they monitor a complete process lifetime, not just the active workload. A quick grep of the paper didn&#x27;t turn up anything discussing this. And it would seem to hurt dynamic languages and runtime-JIT languages a lot. Perhaps the active workload takes long enough that the transient is washed out. Anyone have insights?
评论 #15252502 未加载
评论 #15265391 未加载
boznzover 7 years ago
Considering most CPU cores (Arm&#x2F;X86&#x2F;etc) are optimized for C&#x2F;GCC its an unsurprising result
评论 #15253779 未加载
flukusover 7 years ago
I&#x27;d love to see some scatter plots of CPU-time and energu-time, I expected a fairly linear correlation but there looks to be quite a lot of outliers, some but not all are explained with parallelism. Memory seems all over the place too.
BenoitEssiambreover 7 years ago
Why is TypeScript so much less efficient than JavaScript?
评论 #15252764 未加载
评论 #15252237 未加载
评论 #15252480 未加载
equaluniqueover 7 years ago
Haskell did not shine here. Ocaml did surprisingly well.
Apocryphonover 7 years ago
One wonders how Kotlin (or other popular JVM languages) would compare. And also Objective-C or Smalltalk.
ram_rarover 7 years ago
I am curious to know, if there is any explanation for why java performs better than Go.
评论 #15254799 未加载
评论 #15252324 未加载
评论 #15251625 未加载
评论 #15252893 未加载
problemsmithover 7 years ago
It&#x27;d be nice if these werent images of the tables ...:-\
评论 #15251099 未加载
br1n0over 7 years ago
brief: C is the winner of all the races ( time, energy and memory)
评论 #15253222 未加载
mapletreeover 7 years ago
Nim compiles to C