Daniel Lemire's blog

, 2 min read

Bit packing is fast, but integer logarithm is slow

4 thoughts on “Bit packing is fast, but integer logarithm is slow”

  1. First, OR together all the integers (very fast), then right shift the result until you get all zeros (count the shifts).

    Or am I missing something?

  2. Luke says:

    Thanks for the blog and the code! I like your blog.
    You should get a github/bitbucket account so we can browse your past code easier.
    Thanks!

  3. @Luke

    Thanks you are right.

    Yes, I should create a repository on github for this code, you are right.

  4. @Preston

    As usual, you make me look like an idiot. 😉

    I’m updating my blog post.