base: Use CountLeadingZeroBits for Log2.
Make Log2Floor and Log2Ceiling use CountLeadingZeroBits, which maps to fast underlying CPU instructions. This improves the performance of adding samples to a histogram that relies on Log2Floor to convert values to buckets by 1.5x to 2x. Other code that uses Log2*, will likely see similar benefits. Bug: 807463 Change-Id: Ie21465523d70ce451d8ded6471a0b39107d73d87 Reviewed-on: https://chromium-review.googlesource.com/961490Reviewed-by:danakj <danakj@chromium.org> Commit-Queue: Brian Anderson <brianderson@chromium.org> Cr-Commit-Position: refs/heads/master@{#542972}
Showing
Please register or sign in to comment