diff options
author | Vitaly Lavrov <vel21ripn@gmail.com> | 2021-06-23 10:03:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-23 12:03:52 +0200 |
commit | 35fc6a6de5ab1be3cc4c3c1eb9428b2312a503d0 (patch) | |
tree | 513b073307c4bd44bb2e211be2eaf82c730544be /src/lib/ndpi_utils.c | |
parent | f19937c8c9fd4e1c21988f523d9e78b954f6fcc8 (diff) |
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%).
Diffstat (limited to 'src/lib/ndpi_utils.c')
-rw-r--r-- | src/lib/ndpi_utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index f651ddd64..dddec3299 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -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)); } /* ******************************************************************** */ |