greensoftwarelab / Energy-Languages

The complete set of tools for energy consumption analysis of programming languages, using Computer Language Benchmark Game
MIT License
687 stars 111 forks source link

Add 'Lines of Code' to listing #14

Open void4 opened 6 years ago

void4 commented 6 years ago

It would be interesting to compare program complexity (of which LOC is some sort of measure) to the energy and time usage.

ScottPJones commented 5 years ago

I agree, however, it would be good to measure only lines with code on them, not whitespace, documentation strings or just comments, to not penalize people who actually try to write readable code!

chipbuster commented 2 years ago

Given the nature of the benchmarks, I'm not sure that LOC is a meaningful metric for them. However, if anyone is interested in trying this, the tokei tool can report total lines of code in various languages and differentiate between code, comments, and whitespace for most languages.