On Mon, Jun 26, 2017 at 12:02:09AM +0300, Timofey Titovets wrote:
> +int log2_lshift16(long long unsigned lshift16)
> +{
> +     if (lshift16 < 1)
> +             return -136;
> +     if (lshift16 < 2)
> +             return -123;
> +     if (lshift16 < 3)
> +             return -117;
> +     if (lshift16 < 4)
> +             return -113;
> +     if (lshift16 < 5)
> +             return -110;
> +     if (lshift16 < 6)

Here you have 110 comparisons and branches.  It'd be much better to reorder
those into a sort of a binary search.

-- 
⢀⣴⠾⠻⢶⣦⠀ 
⣾⠁⢠⠒⠀⣿⡁ A dumb species has no way to open a tuna can.
⢿⡄⠘⠷⠚⠋⠀ A smart species invents a can opener.
⠈⠳⣄⠀⠀⠀⠀ A master species delegates.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to