Purty startup could be slightly improved
purty is installed with
node will be started on each invocation, lookup the operating system and launch a child process.
It's not a lot, but this takes time. Linking the binary directly is slightly faster.
Benchmark #1: purty version (node) Time (mean ± σ): 55.9 ms ± 12.6 ms [User: 41.8 ms, System: 12.3 ms] Range (min … max): 42.1 ms … 98.3 ms 48 runs Benchmark #2: ./purty version (link) Time (mean ± σ): 16.0 ms ± 3.3 ms [User: 6.2 ms, System: 8.6 ms] Range (min … max): 9.3 ms … 23.5 ms 208 runs Summary './purty version' ran 3.49 ± 1.06 times faster than 'purty version'
This is not a lot, but depending on how often
purty is invoked, during working on a file, it could make a slight difference, you could feel.
Several things come to my mind, how this information could be leveraged.
- Ideally one could link the binary on installation
- There could be an alternative, easy installation method (is there already one), that doesn't rely on
nix, OS packages, downloading the binary directly, shell script to download binary to path.
- If not done automatically, a hint could be added to the README that using the binary directly is slightly faster.
In general, one can try to keep node dependencies used to a minimal level, but this is already the case. Compare with https://github.com/avh4/binwrap/issues/31 (elm).