diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-05 20:12:44 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-05 20:12:44 +0400 |
commit | 4a79d0e82a5e2040e8dd5d4b8fb12fbf4672d8ce (patch) | |
tree | 5b5db25cbc0924431af3da685b7a0195ee8723a3 /src/worker.c | |
parent | a2d1da15991d59bdc8663bc841258e5affd211ca (diff) | |
download | rspamd-4a79d0e82a5e2040e8dd5d4b8fb12fbf4672d8ce.tar.gz rspamd-4a79d0e82a5e2040e8dd5d4b8fb12fbf4672d8ce.zip |
* Add per-task regexp results cache, that would optimize regexp engine performance
by avoiding multiply match of the same regexp
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/worker.c b/src/worker.c index 1f1548dd1..20e04ed5e 100644 --- a/src/worker.c +++ b/src/worker.c @@ -274,6 +274,8 @@ accept_socket (int fd, short what, void *arg) memory_pool_add_destructor (new_task->task_pool, (pool_destruct_func)rcpt_destruct, new_task); new_task->results = g_hash_table_new (g_str_hash, g_str_equal); memory_pool_add_destructor (new_task->task_pool, (pool_destruct_func)g_hash_table_destroy, new_task->results); + new_task->re_cache = g_hash_table_new (g_direct_hash, g_direct_equal); + memory_pool_add_destructor (new_task->task_pool, (pool_destruct_func)g_hash_table_destroy, new_task->re_cache); worker->srv->stat->connections_count ++; |