<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/librustc_data_structures/bitvec.rs, branch perf-tmp</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=perf-tmp'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2018-09-17T21:08:09+00:00</updated>
<entry>
<title>Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.</title>
<updated>2018-09-17T21:08:09+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>nnethercote@mozilla.com</email>
</author>
<published>2018-09-14T05:07:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=266e2d3d69f61692a4080ff345d05c49d9f3c855'/>
<id>urn:sha1:266e2d3d69f61692a4080ff345d05c49d9f3c855</id>
<content type='text'>
Currently we have two files implementing bitsets (and 2D bit matrices).
This commit combines them into one, taking the best features from each.

This involves renaming a lot of things. The high level changes are as
follows.
- bitvec.rs              --&gt; bit_set.rs
- indexed_set.rs         --&gt; (removed)
- BitArray + IdxSet      --&gt; BitSet (merged, see below)
- BitVector              --&gt; GrowableBitSet
- {,Sparse,Hybrid}IdxSet --&gt; {,Sparse,Hybrid}BitSet
- BitMatrix              --&gt; BitMatrix
- SparseBitMatrix        --&gt; SparseBitMatrix

The changes within the bitset types themselves are as follows.

```
OLD             OLD             NEW
BitArray&lt;C&gt;     IdxSet&lt;T&gt;       BitSet&lt;T&gt;
--------        ------          ------
grow            -               grow
new             -               (remove)
new_empty       new_empty       new_empty
new_filled      new_filled      new_filled
-               to_hybrid       to_hybrid
clear           clear           clear
set_up_to       set_up_to       set_up_to
clear_above     -               clear_above
count           -               count
contains(T)     contains(&amp;T)    contains(T)
contains_all    -               superset
is_empty        -               is_empty
insert(T)       add(&amp;T)         insert(T)
insert_all      -               insert_all()
remove(T)       remove(&amp;T)      remove(T)
words           words           words
words_mut       words_mut       words_mut
-               overwrite       overwrite
merge           union           union
-               subtract        subtract
-               intersect       intersect
iter            iter            iter
```

In general, when choosing names I went with:
- names that are more obvious (e.g. `BitSet` over `IdxSet`).
- names that are more like the Rust libraries (e.g. `T` over `C`,
  `insert` over `add`);
- names that are more set-like (e.g. `union` over `merge`, `superset`
  over `contains_all`, `domain_size` over `num_bits`).

Also, using `T` for index arguments seems more sensible than `&amp;T` --
even though the latter is standard in Rust collection types -- because
indices are always copyable. It also results in fewer `&amp;` and `*`
sigils in practice.
</content>
</entry>
<entry>
<title>Remove bitslice.rs.</title>
<updated>2018-09-13T09:36:03+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>nnethercote@mozilla.com</email>
</author>
<published>2018-09-13T04:19:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b697409f10e70558ef72d39eee4a5f7af60cf16b'/>
<id>urn:sha1:b697409f10e70558ef72d39eee4a5f7af60cf16b</id>
<content type='text'>
This requires the following changes.

- It moves parts of bitslice.rs into bitvec.rs: `bitwise()`,
  `BitwiseOperator`, `bits_to_string()`.

- It changes `IdxSet` to just be a wrapper around `BitArray`.

- It changes `BitArray` and `BitVec` to use `usize` words instead of
  `u128` words. (`BitSlice` and `IdxSet` already use `usize`.) Local
  profiling showed `usize` was better.

- It moves some operations from `IdxSet` into `BitArray`:
  `new_filled()`, `clear()`, `set_up_to()`, `trim_to()` (renamed
  `clear_above()`), `words()` and `words_mut()`, `encode()` and
  `decode(). The `IdxSet` operations now just call the `BitArray`
  operations.

- It replaces `BitArray`'s iterator implementation with `IdxSet`'s,
  because the latter is more concise. It also removes the buggy
  `size_hint` function from `BitArray`'s iterator, which counted the
  number of *words* rather than the number of *bits*. `IdxSet`'s
  iterator is now just a thin wrapper around `BitArray`'s iterator.

- It moves some unit tests from `indexed_set.rs` to `bitvec.rs`.
</content>
</entry>
<entry>
<title>Reorder bitvec.rs.</title>
<updated>2018-09-13T03:27:56+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>nnethercote@mozilla.com</email>
</author>
<published>2018-09-13T03:27:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=755fcae75e9634e6a11651f46d17d7b1310f821b'/>
<id>urn:sha1:755fcae75e9634e6a11651f46d17d7b1310f821b</id>
<content type='text'>
So that the `BitArray` code is all together and before the `BitVector`
code, instead of being awkwardly interleaved.
</content>
</entry>
<entry>
<title>Make SparseBitMatrix a bit lazier.</title>
<updated>2018-08-23T08:41:55+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>nnethercote@mozilla.com</email>
</author>
<published>2018-08-23T04:29:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=002f03b654845667023cdaad8af988909a030bfe'/>
<id>urn:sha1:002f03b654845667023cdaad8af988909a030bfe</id>
<content type='text'>
Currently when a row is instantiated in SparseBitMatrix, any missing
rows prior to it are also fully instantiated.

This patch changes things so that those prior rows are minimally
instantiated (with a `None`). This avoids a decent number of allocations
in NLL, speeding up several benchmarks by up to 0.5%.

The patch also removes two unused methods, `len()` and
`iter_enumerated()`.
</content>
</entry>
<entry>
<title>Rename the fields in `SparseBitMatrix`.</title>
<updated>2018-08-23T06:06:16+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>nnethercote@mozilla.com</email>
</author>
<published>2018-08-23T01:08:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7f4c168a9dd2195b45998ddfecdac111663b26d1'/>
<id>urn:sha1:7f4c168a9dd2195b45998ddfecdac111663b26d1</id>
<content type='text'>
The new names are clearer.
</content>
</entry>
<entry>
<title>A few cleanups for rustc_data_structures</title>
<updated>2018-08-09T17:50:12+00:00</updated>
<author>
<name>ljedrz</name>
<email>ljedrz@gmail.com</email>
</author>
<published>2018-08-09T15:00:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=94c38568048b579c5a29768a8d4bacb8c9d687e1'/>
<id>urn:sha1:94c38568048b579c5a29768a8d4bacb8c9d687e1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Split out growth functionality into BitVector type</title>
<updated>2018-08-01T12:50:40+00:00</updated>
<author>
<name>Mark Rousskov</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2018-07-30T14:58:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9bc4fbb10a1517c2ac5a4c9b0ae3ac6559c90a0d'/>
<id>urn:sha1:9bc4fbb10a1517c2ac5a4c9b0ae3ac6559c90a0d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix `sparse_matrix_iter` unit test</title>
<updated>2018-07-26T13:33:52+00:00</updated>
<author>
<name>Niko Matsakis</name>
<email>niko@alum.mit.edu</email>
</author>
<published>2018-07-26T13:33:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ce576ac259e98138f6e2f19e40a632c279c6a516'/>
<id>urn:sha1:ce576ac259e98138f6e2f19e40a632c279c6a516</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add type parameters to `BitMatrix` and `SparseBitMatrix` unit tests</title>
<updated>2018-07-26T13:33:15+00:00</updated>
<author>
<name>Niko Matsakis</name>
<email>niko@alum.mit.edu</email>
</author>
<published>2018-07-26T13:33:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d376a6bc5d0180758ea2952aed2d374aaa8b093c'/>
<id>urn:sha1:d376a6bc5d0180758ea2952aed2d374aaa8b093c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>convert tests of `BitVector` to use `BitVector&lt;usize&gt;`</title>
<updated>2018-07-26T13:32:13+00:00</updated>
<author>
<name>Niko Matsakis</name>
<email>niko@alum.mit.edu</email>
</author>
<published>2018-07-26T13:32:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5c603e8752874aab0231eecfce5776605f23e05f'/>
<id>urn:sha1:5c603e8752874aab0231eecfce5776605f23e05f</id>
<content type='text'>
</content>
</entry>
</feed>
