Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
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
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment