Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prune: speed up using 1<<N instead of math.Pow(2, N)
This change fixes the use of expensive code that used math.Pow(float(2), N) but really that's expensive code that could be simplified by using left bitshifts. The improvements in speed show in benchmarks: ```shell $ benchstat before.txt after.txt name old time/op new time/op delta Pow2-8 322ns ± 2% 114ns ± 1% -64.69% (p=0.000 n=9+8) name old alloc/op new alloc/op delta Pow2-8 40.0B ± 0% 40.0B ± 0% ~ (all equal) name old allocs/op new allocs/op delta Pow2-8 5.00 ± 0% 5.00 ± 0% ~ (all equal) ``` Fixes #72
- Loading branch information