cgag / loc

Count lines of code quickly.
MIT License
2.31k stars 125 forks source link

polyglot slightly faster than loc #103

Closed gnzlbg closed 6 years ago

gnzlbg commented 6 years ago

From: https://github.com/vmchale/polyglot

polyglot: 143.2 ms loc: 171.8 ms tokei: 304.6 ms

It might be interesting to look at which optimizations they are using.

cgag commented 6 years ago

Hadn't seen this, definitely looks interesting. I'll have to look at what they do for figuring out filetypes when there's no extension as well.

from what i can tell poly doesn't handle multi-line comments, so only checking for // and not / / pairs in c for example, so it's doing less work there

cgag commented 6 years ago

it's really making me want colorful output

gnzlbg commented 6 years ago

I personally find the colorful output overkill for a line counting tool, but I can personally recommend the termcolor crate used by ripgrep - it is really nice.