pengwynn / rdio-cli

CLI for Rdio on Mac
MIT License
101 stars 9 forks source link

RFC: Add basic console as proof of concept #12

Closed brentvatne closed 9 years ago

brentvatne commented 10 years ago

If you're using the cli frequently, you have to deal with the boot up time of the interpreter, loading of libraries etc that adds a good 1.5s to each command, at least on my machine. So I thought it might be useful to have a console command that will just allow us to maintain a rdio-cli session open and skip that boot time.

For example, without console:

$ time rdio help
-- output --
rdio help  1.45s user 0.13s system 99% cpu 1.581 total

$ time rdio current
-- output --
rdio current  1.75s user 0.22s system 85% cpu 2.290 total

With console:

$ rdio c
> help
-- output --
0.010000   0.010000   0.020000 (  0.015161)
> current
-- output --
0.000000   0.010000   0.420000 (  0.766850)

Benchmarking code left in so you can give it a try yourself.

brentvatne commented 9 years ago

No interest in this @pengwynn? :santa:

pengwynn commented 9 years ago

Very cool! Somehow I wasn't watching my own repo, thanks for pinging me. :grinning:

brentvatne commented 9 years ago

Haha thanks @pengwynn - we should probably remove the benchmarking code from there now though ;) I'll do that for you.

pengwynn commented 9 years ago

Ha, I read right over that in the diff. I thought it was just in the example. Thanks.

brentvatne commented 9 years ago

@pengwynn

Removed benchmarking here: https://github.com/pengwynn/rdio-cli/commit/771b06afd2997dabbcf5098cf1b6ae160b43d62e

Also c was a pre-existing shortcut for current, so I just made the console open with rdio console for now: https://github.com/pengwynn/rdio-cli/commit/7067967e22fee9baab4cf5775b49d1794305f92c