How does the timed performance compare?
I’m not sure it will make much difference in this case, but it is generally bad for performance to refer to non-const
global variables inside a function.
Also, I would recommend using CodecZlib.jl over shell commands.