pi-scripts icon indicating copy to clipboard operation
pi-scripts copied to clipboard

Updating the processing step to be more efficient

Open mckeehan opened this issue 1 year ago • 0 comments

Jason, I re-wrote the MAIN body of this script to use a single call to jq making the script much faster (and less resource intensive).

Old:

$ time bash pota-spots
real    0m9.226s
user    0m8.097s
sys     0m1.415s

New:

$ time bash pota-spots
real    0m0.358s
user    0m0.100s
sys     0m0.058s

I also changed the method used to generate temporary files to use mktemp which should be safer....since these files are written to /tmp, it should be relatively safe to just leave them (might be handy if something goes wrong)....or you could add steps in the script to remove them at the end.

de KI4HDU

mckeehan avatar Jul 07 '23 16:07 mckeehan