Skip to content

Commit

Permalink
Auto merge of rust-lang#94709 - martingms:link-to-chunked-opt-pr, r=n…
Browse files Browse the repository at this point in the history
…nethercote

Add link to closed PR for future optimizers of ChunkedBitSet relations

While optimizing these operations proved unfruitful w.r.t. improving compiler performance right now, faster versions might be needed at a later time. This PR adds a link in the FIXME to save any future optimizers some time, as requested by `@nnethercote` in rust-lang#94625.

r? `@nnethercote`
  • Loading branch information
bors committed Mar 7, 2022
2 parents 03918ba + 4d38f15 commit 89adcc6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions compiler/rustc_index/src/bit_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,15 +654,19 @@ impl<T: Idx> BitRelations<ChunkedBitSet<T>> for ChunkedBitSet<T> {

impl<T: Idx> BitRelations<HybridBitSet<T>> for ChunkedBitSet<T> {
fn union(&mut self, other: &HybridBitSet<T>) -> bool {
// FIXME: this is slow if `other` is dense, and could easily be
// improved, but it hasn't been a problem in practice so far.
// FIXME: This is slow if `other` is dense, but it hasn't been a problem
// in practice so far.
// If a a faster implementation of this operation is required, consider
// reopening https://github.com/rust-lang/rust/pull/94625
assert_eq!(self.domain_size, other.domain_size());
sequential_update(|elem| self.insert(elem), other.iter())
}

fn subtract(&mut self, other: &HybridBitSet<T>) -> bool {
// FIXME: this is slow if `other` is dense, and could easily be
// improved, but it hasn't been a problem in practice so far.
// FIXME: This is slow if `other` is dense, but it hasn't been a problem
// in practice so far.
// If a a faster implementation of this operation is required, consider
// reopening https://github.com/rust-lang/rust/pull/94625
assert_eq!(self.domain_size, other.domain_size());
sequential_update(|elem| self.remove(elem), other.iter())
}
Expand Down

0 comments on commit 89adcc6

Please sign in to comment.