Thanks to visit codestin.com
Credit goes to github.com

Skip to content

skywind3000/czmod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Preface

z.lua is fast enough for most case, the path tracking action will be triggered each time when you change your current directory.

So I still recommend the pure lua script for portability and flexibility, but for someone who really care about 10ms or 1ms things, this module can help them to gain the ultimate speed.

Feature

  • Speed up z.lua for history tracking and matching.
  • 20 times smaller than zoxide in binary size.
  • 4-5 times faster than the rust project zoxide.
  • Easy to install.

Install

Install musl-gcc

sudo apt-get install musl-tools

Build the binary

git clone https://github.com/skywind3000/czmod.git ~/github/czmod
cd ~/github/czmod
sh build.sh

Enable the czmod

czmod must be initialized after z.lua:

bash:

eval "$(lua ~/github/z.lua/z.lua --init bash enhanced once echo)"
source ~/github/czmod/czmod.bash

zsh:

eval "$(lua ~/github/z.lua/z.lua --init zsh enhanced once echo)"
source ~/github/czmod/czmod.zsh

Benchmark

Average performance:

Name czmod zoxide
Update Time 1.6ms 7.1ms
Query Time 1.5ms 5.8ms
Binary Size 102 KB 2.2 MB

Benchmark with hyperfine for updating:

and searching:

Credit

TODO

About

🚀 Native Module Written in C to Boost z.lua !!

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5