commit | af5568843594fb71055debe36e521fa8072fcecc | [log] [tgz] |
---|---|---|
author | Bruno Randolf <br1@einfach.org> | Thu Dec 02 19:50:37 2010 +0900 |
committer | John W. Linville <linville@tuxdriver.com> | Mon Dec 06 15:58:43 2010 -0500 |
tree | 4f35966cb4e1018b05c87d7a10c337d888949e22 | |
parent | 5dcc03fe29537edd7819f5b121bf3d779693f37b [diff] |
lib: Improve EWMA efficiency by using bitshifts Using bitshifts instead of division and multiplication should improve performance. That requires weight and factor to be powers of two, but i think this is something we can live with. Thanks to Peter Zijlstra for the improved formula! Signed-off-by: Bruno Randolf <br1@einfach.org> -- v2: use log2.h functions Signed-off-by: John W. Linville <linville@tuxdriver.com>