github.com/davecheney/divmod

Fast integer division experiments for golang


Install
go get github.com/davecheney/divmod

Documentation

Faster Div/Mod for Go linux/arm

BenchmarkUint32Div7     10000000               281 ns/op
BenchmarkUint32Div37    10000000               281 ns/op
BenchmarkUint32Div123   10000000               280 ns/op
BenchmarkUint32Div763   10000000               280 ns/op
BenchmarkUint32Div1247  10000000               281 ns/op
BenchmarkUint32Div9305  10000000               280 ns/op
BenchmarkUint32Div13307 10000000               281 ns/op
BenchmarkUint32Div52513 10000000               281 ns/op
BenchmarkUint32Div60978747      10000000               280 ns/op
BenchmarkUint32Div106956295     10000000               280 ns/op
BenchmarkUint32Mod7     10000000               280 ns/op
BenchmarkUint32Mod37    10000000               280 ns/op
BenchmarkUint32Mod123   10000000               280 ns/op
BenchmarkUint32Mod763   10000000               280 ns/op
BenchmarkUint32Mod1247  10000000               280 ns/op
BenchmarkUint32Mod9305  10000000               280 ns/op
BenchmarkUint32Mod13307 10000000               280 ns/op
BenchmarkUint32Mod52513  5000000               353 ns/op
BenchmarkUint32Mod60978747      10000000               281 ns/op
BenchmarkUint32Mod106956295     10000000               280 ns/op
BenchmarkUint32FastDiv7 10000000               165 ns/op
BenchmarkUint32FastDiv37        10000000               152 ns/op
BenchmarkUint32FastDiv123       10000000               150 ns/op
BenchmarkUint32FastDiv763       10000000               137 ns/op
BenchmarkUint32FastDiv1247      20000000               136 ns/op
BenchmarkUint32FastDiv9305      20000000               122 ns/op
BenchmarkUint32FastDiv13307     20000000               122 ns/op
BenchmarkUint32FastDiv52513     20000000               113 ns/op
BenchmarkUint32FastDiv60978747  20000000                78.0 ns/op
BenchmarkUint32FastDiv106956295 20000000                77.0 ns/op
BenchmarkUint32FastMod7 10000000               164 ns/op
BenchmarkUint32FastMod37        10000000               151 ns/op
BenchmarkUint32FastMod123       10000000               149 ns/op
BenchmarkUint32FastMod763       10000000               137 ns/op
BenchmarkUint32FastMod1247      20000000               136 ns/op
BenchmarkUint32FastMod9305      20000000               122 ns/op
BenchmarkUint32FastMod13307     20000000               122 ns/op
BenchmarkUint32FastMod52513     20000000               113 ns/op
BenchmarkUint32FastMod60978747  20000000                78.5 ns/op
BenchmarkUint32FastMod106956295 20000000                77.8 ns/op