Git Product home page Git Product logo

czmod's People

Contributors

darltrash avatar paysonwallach avatar qqlearn123 avatar skywind3000 avatar stigkj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

czmod's Issues

czmod is not faster than zoxide

Please remove this information from your README, as it is incorrect.

You have done your benchmarking with an empty database. However, this does not reflect a real world use case, where the average user would be expected to have around 500 entries in his/her database. I've written a script to populate both zoxide and z.lua databases, and it can be seen that zoxide runs 5x faster than czmod.

Here is the script:

#!/usr/bin/env bash
rm ~/.zo ~/.zo.tmp ~/.zlua
for i in {1..500}; do
        dirname="/tmp/test$i"
        mkdir -p "$dirname"
        ~/git/zoxide/target/x86_64-unknown-linux-musl/release/zoxide add "$dirname"
        ~/git/czmod/czmod --add "$dirname"
done

Now if I run hyperfine on my machine:

$ hyperfine '~/ws/zoxide/target/x86_64-unknown-linux-musl/release/zoxide 
query test' '~/git/czmod/czmod -e test' --warmup 5000 --min-runs 5000

This is what I get:

Benchmark #1: ~/ws/zoxide/target/x86_64-unknown-linux-musl/release/zoxide query test
  Time (mean ± σ):       0.4 ms ±   0.4 ms    [User: 0.6 ms, System: 0.3 ms]
  Range (min … max):     0.0 ms …   5.2 ms    5000 runs
 
  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Benchmark #2: ~/git/czmod/czmod -e test
  Time (mean ± σ):       2.2 ms ±   0.4 ms    [User: 2.3 ms, System: 0.2 ms]
  Range (min … max):     1.8 ms …   7.0 ms    5000 runs
 
  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Summary
  '~/ws/zoxide/target/x86_64-unknown-linux-musl/release/zoxide query test' ran
    5.01 ± 5.08 times faster than '~/git/czmod/czmod -e test'

I tried to benchmark DB additions, but we have to first set _ZO_MAXAGE and _ZL_MAXAGE to a large number to ensure that all the other entries don't get deleted. However, czmod doesn't seem to follow _ZL_MAXAGE, so I was unable to test this.

I would have liked to test this on another machine, but unfortunately, I only have access to one at the moment. @cole-h, would you be able to do this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.