Skip to content

Instantly share code, notes, and snippets.

@kierdavis
Created September 5, 2016 12:32
Show Gist options
  • Save kierdavis/b301861b32953dda2ab6207fd84fbaf2 to your computer and use it in GitHub Desktop.
Save kierdavis/b301861b32953dda2ab6207fd84fbaf2 to your computer and use it in GitHub Desktop.
Benchmark for countBits32
import nimbench
from math import countBits32
bench(countBits32, m):
var x = 0
for i in 1..m:
x += countBits32(int32(i))
doNotOptimizeAway(x)
runBenchmarks()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment