域配置命中缓存由64增加到4096。

This commit is contained in:
zhengchao
2019-08-30 14:19:07 +08:00
parent 9e0ae6f10d
commit abdfa9a183
4 changed files with 10 additions and 4 deletions

View File

@@ -1878,7 +1878,6 @@ int Maat_stream_scan_digest(stream_para_t * stream_para, const char * data, int
{
struct _stream_para_t* sp=(struct _stream_para_t*)(*stream_para);
int do_query=0;
GIE_result_t region_result[MAX_SCANNER_HIT_NUM];
int hit_region_cnt=0,compile_ret=0;
_compile_result_t compile_result[rule_num];//dynamic array
if(data==NULL||data_len<=0)
@@ -1889,6 +1888,8 @@ int Maat_stream_scan_digest(stream_para_t * stream_para, const char * data, int
{
return 0;
}
GIE_result_t* region_result=sp->feather->scanner->gie_rslt_buff+MAX_SCANNER_HIT_NUM*sp->thread_num;
struct Maat_table_runtime *table_rt=Maat_table_runtime_get(sp->feather->scanner->table_rt_mgr, sp->p_real_table->table_id);
GIE_handle_t* GIE_handle=table_rt->similar.gie_handle;
unsigned long long digest_len=0;
@@ -2065,7 +2066,6 @@ int Maat_similar_scan_string(Maat_feather_t feather,int table_id
{
int hit_region_cnt=0,compile_ret=0;
struct _OUTER_scan_status_t* _mid=NULL;
GIE_result_t region_result[MAX_SCANNER_HIT_NUM];
_compile_result_t compile_result[rule_num];
struct _Maat_feather_t* _feather=(_Maat_feather_t*)feather;
struct Maat_scanner* my_scanner=NULL;
@@ -2087,6 +2087,8 @@ int Maat_similar_scan_string(Maat_feather_t feather,int table_id
{
return 0;
}
GIE_result_t* region_result=my_scanner->gie_rslt_buff+MAX_SCANNER_HIT_NUM*thread_num;
struct Maat_table_runtime* table_rt=Maat_table_runtime_get(my_scanner->table_rt_mgr, p_table->table_id);
if(table_rt->origin_rule_num==0)
{

View File

@@ -1028,6 +1028,7 @@ struct Maat_scanner* create_maat_scanner(unsigned int version,_Maat_feather_t *f
scanner->tomb_ref=feather->garbage_q;
scanner->logger_ref=feather->logger;
scanner->region_rslt_buff=ALLOC(scan_result_t, MAX_SCANNER_HIT_NUM*scan_thread_num);
scanner->gie_rslt_buff=ALLOC(GIE_result_t, MAX_SCANNER_HIT_NUM*scan_thread_num);
scanner->table_rt_mgr=Maat_table_runtime_manager_create(feather->table_mgr, feather->scan_thread_num);
scanner->max_table_num=Maat_table_manager_get_size(feather->table_mgr);
return scanner;
@@ -1067,6 +1068,8 @@ void destroy_maat_scanner(struct Maat_scanner*scanner)
MESA_lqueue_destroy(scanner->region_update_q, lqueue_destroy_cb, NULL);
free(scanner->region_rslt_buff);
scanner->region_rslt_buff=NULL;
free(scanner->gie_rslt_buff);
scanner->gie_rslt_buff=NULL;
alignment_int64_array_free(scanner->ref_cnt);
scanner->ref_cnt=NULL;
for(i=0;i<MAX_CHARSET_NUM;i++)

View File

@@ -2,7 +2,7 @@
#define MAX_EXPR_KEYLEN 1024
#define MAX_DISTRICT_LEN 64
#define MAX_SCANNER_HIT_NUM 64
#define MAX_SCANNER_HIT_NUM 4096
#define MAX_GROUP_CACHE 128
#define MAX_FAILED_NUM 128

View File

@@ -263,6 +263,7 @@ struct Maat_scanner
MESA_lqueue_head region_update_q;
struct bool_matcher * bool_matcher_expr_compiler;
scan_result_t *region_rslt_buff;
GIE_result_t* gie_rslt_buff;
void* logger_ref;
MESA_lqueue_head tomb_ref;//reference of g_feather->garbage_q