diff options
author | Denis Ovsienko <infrastation@yandex.ru> | 2011-12-04 23:21:55 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2012-01-02 17:10:42 +0400 |
commit | e1fabbb86c2558b336b83de443a4fde4b2a8db90 (patch) | |
tree | 901bc9ebd8070f59f9ebdd6075e857c346f50fec /ospfd/.gitignore | |
parent | bf19277c341e6c1b94046c628c0e6d0f0b20d536 (diff) |
lib: optimize ip_masklen()
The new implementation makes use of a 64KB mapping table, which makes it
possible to compute masklen faster and with constant execution time. The
map also allows for additional version of the function, which can detect
errors in input argument.
The previous implementation had a variable cost of execution, which
depended on masklen in a non-linear manner, and at its worst (/31) was
4 times slower, than the new implementation. The only case of old
function just slightly outperforming the new one is /0, which is of
little practical interest.
Diffstat (limited to 'ospfd/.gitignore')
0 files changed, 0 insertions, 0 deletions