Struct selectors::parser::AncestorHashes [] [src]

pub struct AncestorHashes {
    pub packed_hashes: [u32; 3],
}

Ancestor hashes for the bloom filter. We precompute these and store them inline with selectors to optimize cache performance during matching. This matters a lot.

We use 4 hashes, which is copied from Gecko, who copied it from WebKit. Note that increasing the number of hashes here will adversely affect the cache hit when fast-rejecting long lists of Rules with inline hashes.

Because the bloom filter only uses the bottom 24 bits of the hash, we pack the fourth hash into the upper bits of the first three hashes in order to shrink Rule (whose size matters a lot). This scheme minimizes the runtime overhead of the packing for the first three hashes (we just need to mask off the upper bits) at the expense of making the fourth somewhat more complicated to assemble, because we often bail out before checking all the hashes.

Fields

Methods

impl AncestorHashes
[src]

[src]

[src]

Returns the fourth hash, reassembled from parts.

Trait Implementations

impl Clone for AncestorHashes
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for AncestorHashes
[src]

[src]

Formats the value using the given formatter. Read more

impl Eq for AncestorHashes
[src]

impl MallocSizeOf for AncestorHashes
[src]

[src]

Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more

impl PartialEq for AncestorHashes
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.