Speed and memory size optimisation (#1214)
Removed bigram_automata, impossible_bigram_automata, trigram_automata. The ahocorasick structure is replaced with a bitmap. The bitmap size for ndpi_en_bigram is 176 bytes. The bitmap size for ndpi_en_trigram is 2201 bytes. On the test machine, the test execution time was reduced from 27.3 seconds to 24.7 (9%).
This commit is contained in:
@@ -766,7 +766,7 @@ static int ndpi_find_non_eng_bigrams(struct ndpi_detection_module_struct *ndpi_s
|
||||
|
||||
s[0] = tolower(str[0]), s[1] = tolower(str[1]), s[2] = '\0';
|
||||
|
||||
return(ndpi_match_bigram(ndpi_struct, &ndpi_struct->bigrams_automa, s));
|
||||
return(ndpi_match_bigram(s));
|
||||
}
|
||||
|
||||
/* ******************************************************************** */
|
||||
|
||||
Reference in New Issue
Block a user