Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed comparison #38

Closed
dbrgn opened this issue Feb 11, 2018 · 3 comments
Closed

Speed comparison #38

dbrgn opened this issue Feb 11, 2018 · 3 comments
Assignees

Comments

@dbrgn
Copy link
Owner

dbrgn commented Feb 11, 2018

A command line tool for quickly looking up a command should be fast.

Is this client faster than others? If yes, add it to the README.

@dbrgn dbrgn self-assigned this Feb 11, 2018
@dbrgn
Copy link
Owner Author

dbrgn commented Feb 11, 2018

Test case: Measuring real time for tldr tar using the time command.

I measured the command 5 times and calculated the average.

Tealdeer

cd tealdeer
cargo build --release
time target/release/tldr tar

Times: 15ms / 11ms / 5ms / 5ms / 11ms -> 9.4ms

C Client

cd tldr-cpp-client
make
./tldr -u
time ./tldr tar

Times: 11ms / 5ms / 12ms / 11ms / 15ms -> 10.8ms

NodeJS Client

npm install tldr
node_modules/.bin/tldr --update
time node_modules/.bin/tldr tar

Times: 169ms / 171ms / 170ms / 170ms / 170ms -> 170.0ms

Python client

cd tldr.py
python3 -m venv venv
venv/bin/pip install .
git clone https://github.com/tldr-pages/tldr source
venv/bin/tldr init
venv/bin/tldr reindex
time venv/bin/tldr find tar

Times: 152ms / 148ms / 151ms / 158ms / 140ms -> 149.8ms

Bash client

cd tldr-bash-client
./tldr -u
time ./tldr tar

Times: 15ms / 19ms / 22ms / 25ms / 24ms -> 21.0ms

Go client by k3mist

cd dist/build/linux
./tldr tar
time ./tldr tar

Times: 98ms / 96ms / 100ms / 95ms / 101ms -> 98.8ms

Haskell client

I didn't manage to compile this:

stack setup
Downloaded lts-10.0 build plan.    
AesonException "Error in $.packages.cassava.constraints.flags['bytestring--lt-0_10_4']: Invalid flag name: \"bytestring--lt-0_10_4\""

Not sure whether I'm doing this right :)

Ruby client

I didn't manage to compile this:

Downloading ruby-2.2.2.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.bz2
Installing ruby-2.2.2...

WARNING: ruby-2.2.2 is nearing its end of life.
It only receives critical security updates, no bug fixes.


BUILD FAILED (Arch rolling using ruby-build 20171226)

Inspect or clean up the working tree at /tmp/ruby-build.20180211132117.14606
Results logged to /tmp/ruby-build.20180211132117.14606.log

Last 10 log lines:
linking shared-object pathname.so
make[2]: Leaving directory '/tmp/ruby-build.20180211132117.14606/ruby-2.2.2/ext/pathname'
linking shared-object bigdecimal.so
make[2]: Leaving directory '/tmp/ruby-build.20180211132117.14606/ruby-2.2.2/ext/bigdecimal'
linking shared-object date_core.so
make[2]: Leaving directory '/tmp/ruby-build.20180211132117.14606/ruby-2.2.2/ext/date'
linking shared-object nkf.so
make[2]: Leaving directory '/tmp/ruby-build.20180211132117.14606/ruby-2.2.2/ext/nkf'
make[1]: Leaving directory '/tmp/ruby-build.20180211132117

Not sure whether I'm doing this right :)

Perl client

Not sure how to run this without installing it systemwide.

Can't locate App/tldr.pm in @INC (you may need to install the App::tldr module) (@INC contains: /home/danilo/.opam/tezos/lib/perl5 /usr/lib/perl5/5.26/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.26/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.26/core_perl /usr/share/perl5/core_perl) at script/tldr line 5.
BEGIN failed--compilation aborted at script/tldr line 5.

Go client by anoopengineer

Didn't work for me:

cd tldr_0.1.4_linux_amd64
./tldr --update-cache tar
INFO[0000] Downloading fresh tldr's from https://github.com/tldr-pages/tldr/archive/master.zip 
FATA[0000] user: Current not implemented on linux/amd64 

PHP client

Didn't work for me:

cd tldr-php
composer install
./tldr -u

...this blocks forever (>3min).

dbrgn added a commit that referenced this issue Feb 11, 2018
dbrgn added a commit that referenced this issue Feb 11, 2018
dbrgn added a commit that referenced this issue Feb 11, 2018
@dbrgn dbrgn closed this as completed Feb 11, 2018
@kvnxiao
Copy link

kvnxiao commented Aug 11, 2020

@dbrgn Do you think you can revisit this issue using https://github.com/sharkdp/hyperfine to test the startup time of all the executables? (and also list your hardware, even though it shouldn't matter that much in this use case, it would provide more authenticity to the tests)

@dbrgn
Copy link
Owner Author

dbrgn commented Aug 12, 2020

@kvnxiao oh, that's a nice tool! I opened #129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants