]> git.karo-electronics.de Git - linux-beck.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)
commit2bbf29acd8f7adcf161de7e5d891b4095687a59f
tree955b15fa3bcdee1f879949d8639c5e9d5b82e84e
parent44158306d756c88272c8faf243ca68897498e219
[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