Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Wanna talk about JS? Java?


Contrary to popular belief, Java is amongst the most efficient languages regarding power consumption.


I was referencing directly the amount of compilation, not necessarily the power consumption. But with regards to ecological impact, I would guess you have Java on a server in your mind.

But, the biggest Java user in term of number of devices is Android. And every time you install an app, you compile it. Including every time you update it (which nowadays is... everyday?). Also it'll recompile in background to use pgo. Nowadays [1] Google could pretty much compile it server-side for most devices, and save a lot of battery wear (batteries wear when getting hot, and compiling, weirdly, heats), in addition to power consumption.


It depends on how you use it. For long running applications like services, yeah, the JIT will get the bytecode down to some very high quality machine code. If you write lots of small applications and compose them using something like Unix, then Java is very inefficient.


That's so funny that Java was also the first thing that i had in my mind...also python and "LLM training".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: