]> git.lizzy.rs Git - rust.git/commit
Speed up `SparseBitMatrix`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 18 Jul 2018 05:03:43 +0000 (15:03 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Fri, 20 Jul 2018 05:15:06 +0000 (15:15 +1000)
commit798209e78b90b83a3742f713b70473b6ab799aca
tree5eb9ba867cbd0c8721321f0ac3a2d45c86085ff4
parent4f3c7a472b77ba3f3afbc12d004b9d1bbcee7fe7
Speed up `SparseBitMatrix`.

Using a `BTreeMap` to represent rows in the bit matrix is really slow.
This patch changes things so that each row is represented by a
`BitVector`. This is a less sparse representation, but a much faster
one.

As a result, `SparseBitSet` and `SparseChunk` can be removed.

Other minor changes in this patch.

- It renames `BitVector::insert()` as `merge()`, which matches the
  terminology in the other classes in bitvec.rs.

- It removes `SparseBitMatrix::is_subset()`, which is unused.

- It reinstates `RegionValueElements::num_elements()`, which #52190 had
  removed.

- It removes a low-value `debug!` call in `SparseBitMatrix::add()`.
src/librustc_data_structures/bitvec.rs
src/librustc_mir/borrow_check/nll/region_infer/values.rs