Skip to content
Snippets Groups Projects
Commit af556884 authored by Bruno Randolf's avatar Bruno Randolf Committed by John W. Linville
Browse files

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: default avatarBruno Randolf <br1@einfach.org>

--

v2:	use log2.h functions
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5dcc03fe
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment