Starts off with unnecessary use of cat, e.g., cat file | awk 'cmds'.
One can simply do awk 'cmds' file.
One can simply do awk 'cmds' file.
And if the extra cat is actually making a measurable difference, maybe that's a good signal that it's time to rewrite it in C.
$ cat data.txt | awk '{ print $2+$4,$0 }'|sort|sed '/^0/d'
can be written as $ <data.txt awk '{ print $2+$4,$0 }'|sort|sed '/^0/d'