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:
Vitaly Lavrov
2021-06-23 12:03:52 +02:00
committed by GitHub
parent f19937c8c9
commit 35fc6a6de5
4 changed files with 56 additions and 84 deletions
+1 -1
View File
@@ -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));
}
/* ******************************************************************** */