Abstract: Systems and methods for reducing network performance degradation by assigning caching priorities to one or more states of a state machine are disclosed herein. In one embodiment, the method comprises storing, in a memory, a state machine corresponding to one or more patterns to be detected in a data stream, wherein the state machine comprises a plurality of states, generating a test data stream based on the one or more patterns, traversing the state machine with the test data stream, determining a respective hit quantities associated with each of the plurality of states, the hit quantities each indicating a number of accesses to a corresponding state by the traversing, and associating a caching priority to at least some of the plurality of states based on the hit quantities of the respective states.