From 7cfd7962ea1db9d35c34f9c1cad0adb00d934b56 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Fri, 23 Nov 2018 18:51:55 +0800 Subject: [PATCH] update doc --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 1028beb..11adec6 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,33 @@ z -e foo # echo the best match, don't cd - set `$_ZL_NO_PROMPT_COMMAND` if you're handling PROMPT_COMMAND yourself. - set `$_ZL_EXCLUDE_DIRS` to an array of directories to exclude. +## Benchmark + +The slowest part of all autojump tools is path tracking, which is installed in your `$PROMPT_COMMAND` and will be invoked each time you press enter (each time before bash display prompt). So I profile them on my NAS: + +```bash +$ time autojump --add /tmp +real 0m0.352s +user 0m0.077s +sys 0m0.185s + +$ time fasd -A /tmp +real 0m0.618s +user 0m0.076s +sys 0m0.242s + +$ time _z --add /tmp +real 0m0.194s +user 0m0.046s +sys 0m0.154s + +$ time _zlua --add /tmp +real 0m0.052s +user 0m0.015s +sys 0m0.030s +``` + +As you see, z.lua is the fastest one and requires less resource. ## Credit