[OPTIM] halog: use a faster zero test in fgets()
authorWilly Tarreau <w@1wt.eu>
Tue, 4 May 2010 08:47:57 +0000 (10:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 May 2010 09:04:54 +0000 (11:04 +0200)
commit1769a18f6257ee1025774b0540f580271c75c4fa
tree34a0dd1f680fdaf4d2c3cb7177284afe0ef562a2
parent0f423a70730bc42de75222b3c00404532f084010
[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%.
contrib/halog/fgets2-64.c
contrib/halog/fgets2.c