×
Login Register an account
Top Submissions Explore Upgoat Search Random Subverse Random Post Colorize! Site Rules
8

Is Rust more energy efficient?

submitted by v0atmage to programming 2.2 yearsFeb 20, 2022 21:08:01 ago (+8/-0)     (archive.is)

https://archive.is/fLecH



2 comments block


[ - ] account deleted by user 0 points 2.1 yearsMar 27, 2022 23:24:44 ago (+0/-0)

account deleted by user

[ - ] bonghits4jeebus 3 points 2.2 yearsFeb 21, 2022 00:12:29 ago (+4/-1)

Appears so. Rust appears to be compiled to machine code, so it has not the overhead of an interpreter. Seems like they're pretty tight about which features they incorporate, too, which reduces the number of "if"s that have to be inserted by the compiler to handle branching that is implicit in the original syntax. C++, in my experience, is particularly bad about dumping just reams of machine code based on relatively compact input. You know, when you use the features of C++ like the object-oriented principles, exceptions, and run-time typing.

Rust does not use automated garbage collection.

Yeah, garbage collection is going to suck resources -- stopping whatever you're doing to look for bits of memory that can be freed back to pool.

It's interesting because we don't usually evaluate power usage as such. Usually we want to know memory and CPU cycle usage -- stuff that leads to power consumption. Ultimately, you're usually racing towards idle. So efficiency in runtime, in particular, translates directly to efficiency in power. IDK much about how reducing memory overhead leads to power savings. I feel like you usually pay the cost for having RAM whether you are actually changing the values within it or not.