1
0
mirror of https://github.com/golang/go synced 2024-11-05 17:46:16 -07:00
Commit Graph

7 Commits

Author SHA1 Message Date
Alan Donovan
5fe8afcb15 container/intsets: add benchmark of AppendTo method.
Also:
- increase sparsity of sets in benchmarks.
- removed TODO in forEach.  Subword masks had no benefit.
- minor cleanup.

LGTM=crawshaw
R=crawshaw
CC=golang-codereviews
https://golang.org/cl/103470049
2014-06-19 14:35:37 -04: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
65906ce503 go.tools/container/intsets: support negative elements in BitString().
(I forgot about this when we added support for negative elements generally.)

We use floating point for negative numbers.  The order of the
output is reversed from the previous (little-endian) behaviour
since it makes for more readable floating point.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/95570043
2014-05-20 14:52:50 -04:00
Rob Pike
6f17d00f0d go.tools: fix various minor issues found by go vet
LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/96360048
2014-05-19 08:47:28 -07:00
Alan Donovan
174d6e8ca3 go.tools/container/intsets: use " " not ", " as (*Sparse).String() separator.
This is both easier to read and 25% shorter (helpful when
using String() as a map key for interning sets).

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/96370045
2014-05-16 13:06:08 -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