From 4a79d0e82a5e2040e8dd5d4b8fb12fbf4672d8ce Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 5 Apr 2009 20:12:44 +0400 Subject: * Add per-task regexp results cache, that would optimize regexp engine performance by avoiding multiply match of the same regexp --- src/expressions.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/expressions.h') diff --git a/src/expressions.h b/src/expressions.h index 5c2a391eb..5e7e134e6 100644 --- a/src/expressions.h +++ b/src/expressions.h @@ -88,4 +88,20 @@ void re_cache_add (char *line, void *pointer); */ void * re_cache_check (const char *line); +/** + * Add regexp to regexp task cache + * @param task task object + * @param pointer regexp data + * @param result numeric result of this regexp + */ +void task_cache_add (struct worker_task *task, void *pointer, int32_t result); + +/** + * Check regexp in cache + * @param task task object + * @param pointer regexp data + * @return numeric result if value exists or -1 if not + */ +int32_t task_cache_check (struct worker_task *task, void *pointer); + #endif -- cgit v1.2.3