4 ms·
disclaimer: I'm not using the fonts, but it attempts to render them anyway. Here's what `time ls` and `time lc` produced, in a directory with 517 files: > ls
by alekratz 9y ago
disclaimer: I'm not using the fonts, but it attempts to render them anyway.
Here's what `time ls` and `time lc` produced, in a directory with 517 files:
> ls --color=tty -l 0.01s user 0.00s system 93% cpu 0.007 total
> ~/.gem/ruby/2.4.0/bin/lc 0.14s user 0.01s system 98% cpu 0.159 total
It's definitely noticeable, especially if you use `ls` day-in, day-out. But it's nothing debilitating.
- pmontra 9y agoProbably it could be made faster by working a little with InstructionSequence https://ruby-doc.org/core-2.4.1/RubyVM/InstructionSequence.html https://ruby-doc.org/core-2.4.1/RubyVM/InstructionSequence.h... and creating a "compiled" file to save the parsing time. I played with it on the day they released Ruby 2.3. It's not meant for distributing code across machines and it could fail on the same machine after some updates. It's probably not worth it to shave 152 ms on an interactive command.
- xanderstrike 9y agoThe fonts don't seem to matter. This thing is super cool but I disagree that it's not debilitating. `ls` on my home directory takes 0.005 real, `colorls` takes 0.554 real. Over 100x as long and it's an extremely noticeable half second.