Use tmpfs for speed and I/O reduction (#1122)

This commit is contained in:
David Delarosa 2022-05-25 18:13:38 +03:00 committed by GitHub
parent f70612800b
commit d283f12ef9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ update() {
read -r i < "$arg" read -r i < "$arg"
sum=$(( sum + i )) sum=$(( sum + i ))
done done
cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/} cache=/tmp/${1##*/}
[ -f "$cache" ] && read -r old < "$cache" || old=0 [ -f "$cache" ] && read -r old < "$cache" || old=0
printf %d\\n "$sum" > "$cache" printf %d\\n "$sum" > "$cache"
printf %d\\n $(( sum - old )) printf %d\\n $(( sum - old ))