It can be. This this case however it is limited to eth0, tcp, port 22. If any of those don't match there will be no parsing and thus no impact. Another mitigating factor is that we are only looking at specific byte regions of the packet so parsing is minimized. On busy SFTP servers I would probably avoid using such rules if CPU load is becoming a problem. For most people this will not even register in htop or vmstat. There are also ways to use this string check in combination with ipset and/or xt_recent to minimize the times we see a packet from a bot. Here is an example using an IPSet called "bots" that we drop early on in the raw table and also use in the filter outbound rules to reset openssh trying to respond the first time we see the bad string so we close the socket earlier.
In a startup / init script / systemd unit file:
In this example I am using a bigger netmask much in the way name servers rrl rate limit.In the raw table, drop bots we saw for a week:
In the filter table outbound rules: This should only be performed on servers that one has console / out-of-band access to, after exhaustive testing.