Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

rewrite vsv in Rust for v2 #15

Open
wants to merge 109 commits into
base: master
Choose a base branch
from
Open

rewrite vsv in Rust for v2 #15

wants to merge 109 commits into from

Conversation

bahamas10
Copy link
Owner

@bahamas10 bahamas10 commented Mar 1, 2022

This has been a long-time coming on my end, but this is the base for rewriting vsv in rust. First things first:

I know the convenience of having all of vsv in a single bash script that can easily be installed via curl or wget - so i will continue to support that in ./old/vsv.

However, the speed increase when listing services on low-end devices (namely my raspberry pi 2) is amazing. The Rust version is able to grab the information in parallel and process it much faster.

Bash version:

bash-5.1# time /home/dave/dev/vsv/old/vsv status >/dev/null

real	0m0.715s
user	0m0.386s
sys	0m0.301s

Rust version:

bash-5.1# time /home/dave/dev/vsv/target/release/vsv status >/dev/null

real	0m0.014s
user	0m0.000s
sys	0m0.020s

Both processing 14 services.


Using a synthetic benchmark with 1,000 services the performance benefit becomes clear:

Bash version

$ time SVDIR=$PWD/benchmarks/service PROC_DIR=$PWD/benchmarks/proc ./old/vsv status >/dev/null

real	0m9.394s
user	0m2.557s
sys	0m5.699s

Rust version

$ time SVDIR=$PWD/benchmarks/service PROC_DIR=$PWD/benchmarks/proc ./target/release/vsv status >/dev/null

real	0m0.057s
user	0m0.016s
sys	0m0.272s

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

Successfully merging this pull request may close these issues.

1 participant