Commit Graph

1 Commits

Author SHA1 Message Date
Alan Donovan 2c49d4f1ee container/intsets: use std math/bits routines
Remove home-made popcount/nlz/ntz routines, now that the standard
library provides them. The Popcount benchmark (now deleted) showed that
the std implementation was much faster (0.45ns vs 1.5ns) on an Intel Core i9
(MacBook Pro), likely due to the compiler's intrinsic reduction of OnesCount
to an inline POPCNT instruction, avoiding the function call overhead.

Change-Id: I5a6acfb3bcb61b0b2ee3e6da370c0fab78e50c2d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/374454
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-28 19:10:34 +00:00