]> git.baikalelectronics.ru Git - kernel.git/commit
[DCCP] tfrc: Binary search for reverse TFRC lookup
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Sun, 3 Dec 2006 16:53:27 +0000 (14:53 -0200)
committerArnaldo Carvalho de Melo <acme@mandriva.com>
Sun, 3 Dec 2006 16:53:27 +0000 (14:53 -0200)
commit7b2a25f7bf52bfb34aabc9f3eca0e4e8698b5533
tree955b15fa3bcdee1f879949d8639c5e9d5b82e84e
parent1a43e7b53c0b27010b4440966b6cc1139d5820bd
[DCCP] tfrc: Binary search for reverse TFRC lookup

This replaces the linear search algorithm for reverse lookup with
binary search.

It has the advantage of better scalability: O(log2(N)) instead of O(N).
This means that the average number of iterations is reduced from 250
(linear search if each value appears equally likely) down to at most 9.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
net/dccp/ccids/lib/tfrc_equation.c