haproxy/contrib/halog
Willy Tarreau 9f66aa9cc4 CONTRIB: halog: avoid calling time/localtime/mktime for each line
The last commit provides time-based filtering. Unfortunately, it wastes
90% of the time calling the expensive time()/localtime()/mktime()
functions.

This patch does 3 things :
  - call time()/localtime() only once to initialize the correct
    struct timeinfo ;

  - call mktime() only when the time has changed regardless of
    the current second.

  - manually add the current second to the cached result.

Doing just this is enough to multiply the parsing speed by 8.
2014-05-23 16:40:25 +02:00
..
fgets2.c OPTIM: halog: make use of memchr() on platforms which provide a fast one 2012-06-12 08:52:22 +02:00
halog.c CONTRIB: halog: avoid calling time/localtime/mktime for each line 2014-05-23 16:40:25 +02:00
Makefile OPTIM: halog: make use of memchr() on platforms which provide a fast one 2012-06-12 08:52:22 +02:00