## 5 Experimental Results
### Throughput Analysis
#### 5.3.3 Proposed Algorithm  
Algorithm 3 shows pseudo-code of the parallel implementation of the PA that executes the pattern-matching process using multiple CUDA threads. Here, InChar represents the character on the target text, cs represents the current state, and pos represents the position on the target text. The pattern-matching process performed using the PA is conducted in three different versions. In the first version, all tables and network packets are held in global memory (PA). In the second version, while network packets are held in shared memory (PA-ps), all tables are held in global memory. In the last version, all tables are held in shared memory and network packets are held in global memory (PA-s). Figures 13 and 14, respectively, compare the packet-processing times and throughputs of these pattern-matching versions applied to datasets with different numbers of patterns.  
```
input: CC, CO, InChar, cs, pos GetCluster(InChar,CC); if cluster is not equal -1 then GetCharacterSignature(CO); GetStateSignature(CO); GetCharacterSignature(InChar,CC); if Character signatures of CC and CO are equal then UpdateState(cs); whilecs is greater than 0 and pos is less than 256 do ifcs has state code then ifTarget text and state text are equal then UpdateInCharPosition(InChar,pos); GetCluster(InChar,CC); GetStateCodeLenght(cs); whileState code length is greater than 0 do
```  
Figure 12: Comparison of the throughputs obtained from the pattern\(-\)matching tests performed using the WM algorithm.  
Similar to the AC and WM algorithms, the pattern-matching performance of the PA is also related to the memory space required by the algorithm and access overheads. In addition, an increase in the number of common-rooted patterns negatively affects performance. An increase in the number of examined patterns increases the number of patterns with a common root, reducing the number of characters processed in the transition between two states. Since each byte in the packet payload is processed individually, the DPI-matching process becomes more computationally intensive and time-consuming. On the other hand, decreasing the number of characters processed in the transition between two states can increase the transition numbers in the automaton, resulting in more complex state codes. In this case, the algorithm sequentially scans all transitions in the state code to determine the appropriate subcode. As a result, the pattern-matching speed drops for large pattern datasets. Also, executing packet processing in shared memory with shorter access latency instead of global memory reduces the packet-processing time (Figure 13). Therefore, the highest throughput is obtained in tests where the tables used in the pattern-matching process are in shared memory (Figure 14). The tests in which only network packets are in  
Figure 13: Comparison of the packet-processing times obtained from the pattern-matching tests performed using the PA.  
shared memory have the second-highest efficiency, while the tests in which all tables and network packets are in global memory have the lowest efficiency.  
Threads act independently of access patterns while detecting patterns using the PA. These threads access random positions of the CC and CO tables to determine the next state. This situation causes uncoalesced memory accesses. Also, the absence of any access pattern during the pattern detection causes bank conflicts on shared memory. An increase in the number of examined patterns increases the number of entries in the tables used in the pattern-matching process. This causes more bank conflicts in tests where tables are kept in shared memory. Increasing bank conflicts affect the pattern-matching performance negatively and decrease efficiency.