cgag/loc

polyglot slightly faster than loc

gnzlbg opened this issue · 3 comments

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

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

it's really making me want colorful output

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.