Serial Port - Buffering questions - "sliding" / ring buffer performance

You probably want "KMP string search on a stream", which I can find several useful descriptions and ada implementations, but nothing set up for the really austere arduino environment.
Sliding your string is a bad idea, it's much better to implement a st ring compare that wraps around the circle of a buffer...