1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:34:51 -07:00
Commit Graph

6 Commits

Author SHA1 Message Date
Alan Donovan
81cc31eaa9 Revert "x/tools/container/intsets: remove unused function"
This reverts commit 79902b439b.

Reason for revert: build broken on some platforms.

Change-Id: I5ceddc305580ff97f47ae27da831f99e96dab424
Reviewed-on: https://go-review.googlesource.com/37539
Reviewed-by: David R. Jenni <david.r.jenni@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-03-01 14:51:44 +00:00
David R. Jenni
79902b439b x/tools/container/intsets: remove unused function
Found with honnef.co/go/tools/cmd/unused.

Change-Id: I54dab41d423050b883a3af1f5bb8c5119e2b7100
Reviewed-on: https://go-review.googlesource.com/37602
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-03-01 14:40:33 +00:00
Alan Donovan
b7f0150d16 container/intsets: popcount: use POPCNT on amd64, Hacker's Delight algorithm on 386
This function accounts for 2% of "godoc -analysis=pointer"
and this change makes it twice as fast---and simpler.

Added test and benchmark.

Change-Id: I8578fa42dce34df057d81f6c522a7b4e0506d09d
Reviewed-on: https://go-review.googlesource.com/15211
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-10-01 19:57:28 +00:00
Alan Donovan
fd72015344 go.tools/container/intsets: increase block size to 256 bits.
This consistently yields better performance with go/pointer.

Also: return int not word from ntz().

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/97570044
2014-05-30 13:21:36 -04:00
Alan Donovan
e1b97610f0 go.tools/container/intsets: fix compile error on 32-bit platforms.
Also, fix typo.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/99310043
2014-05-15 14:03:05 -04:00
Alan Donovan
61c5c64029 go.tools/container/intsets: Sparse: a space-efficient representation for ordered sets of int values.
intsets.Sparse is a sparse bit vector.  It uses space proportional
to the number of elements, not the maximum element (as is the case		for a dense bit vector).

A forthcoming CL will make use of it in go/pointer, where it reduces
solve time by 78%.  A similar representation is used for Andersen's
analysis in gcc and LLVM.

+ Tests.

LGTM=sameer, crawshaw, gri
R=gri
CC=crawshaw, golang-codereviews, sameer
https://golang.org/cl/10837043
2014-05-14 17:54:14 -04:00