Commit Graph

7 Commits

Author SHA1 Message Date
Willy Tarreau 419a598eae OPTIM: halog: make use of memchr() on platforms which provide a fast one
glibc-2.11 on x86_64 provides a machine-specific memchr() which is faster
than the generic C implementation by around 40%, so let's make it possible
to use it instead of the hand-coded version.
2012-06-12 08:52:22 +02:00
Willy Tarreau de5dc0509c MINOR: halog: use the more recent dual-mode fgets2 implementation
This version implements both 32 and 64 bit versions at once, it
avoids the need to have two separate output files. It also improves
efficiency on i386 platforms by adding a little bit of assembly where
gcc isn't efficient.
2012-06-09 11:22:27 +02:00
Willy Tarreau 31a02e9c5b [OPTIM] halog: make fgets parse more bytes by blocks
By adding a "landing area" at the end of the buffer, it becomes safe to
parse more bytes at once. On 32-bit this makes fgets run about 4% faster
but it does not save anything on 64-bit.
2011-09-10 10:46:39 +02:00
Willy Tarreau 96c148b0d2 [MINOR] halog: do not consider byte 0x8A as end of line
A bug in the algorithm used to find an LF in multiple bytes at once
made byte 0x80 trigger detection of byte 0x00, thus 0x8A matches byte
0x0A. In practice, this issue never happens since byte 0x8A won't be
displayed in logs (or it will be encoded). This could still possibly
happen in mixed logs.
2011-09-09 08:21:55 +02:00
Willy Tarreau 812e7a73b2 [BUG] halog: correctly handle truncated last line
If last line is truncated (eg: truncated file), then halog would loop on
it forever.
2011-07-11 06:48:02 +02:00
Willy Tarreau 1769a18f62 [OPTIM] halog: use a faster zero test in fgets()
A new idea came up to detect the presence of a null byte in a word.
It saves several operations compared to the previous one, and eliminates
the jumps (about 6 instructions which can run 2-by-2 in parallel).

This sole optimisation improved the line count speed by about 30%.
2010-05-04 11:04:54 +02:00
Willy Tarreau 214c203c00 [CONTRIB] halog: faster fgets() and add support for percentile reporting
A new fgets implementation saves about 25-50% of the time spent parsing
the logs.

Percentile calculation has been added for timers using -pct.
2009-03-09 00:42:39 +01:00