Closed mipearson closed 9 years ago
Awesome! Have to get this up and going on my local puter.
So I sent our new terminal gear live on Monday, seems to be going well. It now shells out to the Ruby terminal gem, does the string encoding forcing in Ruby beforehand, and the unicode emojification afterwards. So dropping it for ansi2html should be a cinch. I'll probably feature flag it so we can test with a bunch of accounts first.
I'm wondering… should we keep this repo alive as terminal-ruby with an "unmaintained notice" in the Readme, and leave the gem on rubygems, and start this as a new repo?
Up to you! I'd probably just leave a branch or tag as "last ruby commit" or something.
Just did some testing on a 4MB log:
$ time cat log_4MB.txt | ansi2html > /dev/null
real 0m0.623s
user 0m0.537s
sys 0m0.091s
$ time cat log_4MB.txt | terminal > /dev/null
real 0m8.724s
user 0m7.987s
sys 0m0.587s
Couldn't tell the memory usage for ansi2html because it executed so quickly… whereas terminal hits 1.4GB.
Now just doing some diffing to see if there's any difference in output…
Diffs look good!
Thinking of names… being this is "Terminal" and the command is "ansi2html"… and did a search and found https://github.com/ralphbean/ansi2html/
Yeah - I'd certainly keep the library name as 'terminal'. Maybe the command can be terminal-convert
?
So, thanks to Andy Snow (https://twitter.com/andy_snow/status/570409324322770945):
What happens if you use GNU time with -v?
Look for "Maximum resident set size (kbytes)"
You can install GNU time on OSX with brew install gnu-time
or, if already on Linux, just call /usr/bin/time
(instead of shell time)
I made a 4mb file by concatenating npm.sh.raw with itself a bunch of times. Running that with GNU time -v on OSX gives me in Go a runtime of 1.06sec, with a maximum RSS of 816mb.
Switching back to Ruby, I get 9.2s and 3106gb RSS.
An improvement on the RSS, but .. I wonder if I can do better :)
Ace! Looks good.
Yeah, perhaps terminal-to-html
?
And keep the go lib as terminal?
WFM, done.
On Wed, Feb 25, 2015 at 1:55 PM, Tim Lucas notifications@github.com wrote:
And keep the go lib as terminal?
— Reply to this email directly or view it on GitHub https://github.com/buildkite/terminal/pull/14#issuecomment-75896626.
Michael Pearson
As you were curious re the memory usage, NPM was 70ms/op and 27mb/op. Not sure what that translates to when run from the CLI (as I know that Go's own runtime adds a fair bit of weight)