Simple tool to measure how much a file's size has changed, e.g., between different builds of an application.
Simply cp src/sd.py /usr/local/bin/sd or wherever is customary for the system you're using. There are no
external dependencies, only Python's standard library. Certified Works on My Machine on Python 3.12.10.
Given the files x and y:
$ echo -n 'a' > x
$ echo -n 'bb' > y
Provide a reference file for other files to compare against:
$ sd --reference-file x --file y
y is 100.00% larger than x
$ sd --reference-file y --file x
x is 50.00% smaller than y
Pass --quiet to get a more scripting-friendly output:
$ sd --quiet --reference-file x --file y
+100.00
$ sd --quiet --reference-file y --file x
-50.00
The usual --help is available for more detailed documentation.