Generally speaking, the top-end of xz very slightly beats the top-end of zstd. However, xz typically takes several
times as long to extract. And
generally I've seen xz take longer to compress than zstd, as well.
Example with a large archive (representative of compiled software distribution, such as package management formats):
$ time xz -T0 -9k usrbin.tar
real 2m0.579s
user 8m46.646s
sys 0m2.104s
$ time zstd -T0 -19 --long usrbin.tar
real 1m47.242s
user 6m34.845s
sys 0m0.544s
/tmp$ ls -l usrbin.tar*
-rw-r--r-- 1 josh josh 998830080 Jul 23 23:55 usrbin.tar
-rw-r--r-- 1 josh josh 189633464 Jul 23 23:55 usrbin.tar.xz
-rw-r--r-- 1 josh josh 203107989 Jul 23 23:55 usrbin.tar.zst
/tmp$ time xzcat usrbin.tar.xz >/dev/null
real 0m9.410s
user 0m9.339s
sys 0m0.060s
/tmp$ time zstdcat usrbin.tar.zst >/dev/null
real 0m0.996s
user 0m0.894s
sys 0m0.065s
Comparable compression ratio, faster to compress, 10x faster to decompress.
And if you do need a smaller compression ratio than xz, you can get that at a cost in time:
$ time zstd -T0 -22 --ultra --long usrbin.tar
real 4m32.056s
user 9m2.484s
sys 0m0.644s
$ ls -l usrbin.tar*
-rw-r--r-- 1 josh josh 998830080 Jul 23 23:55 usrbin.tar
-rw-r--r-- 1 josh josh 189633464 Jul 23 23:55 usrbin.tar.xz
-rw-r--r-- 1 josh josh 186113543 Jul 23 23:55 usrbin.tar.zst
And it still takes the same amount of time to extract, 10x faster than xz.