Commit graph

19 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
9eaadc6860 style: Shutdown Servo's thread-pool in leak-checking builds, leak the atom table elsewhere.
Differential Revision: https://phabricator.services.mozilla.com/D44217
2019-09-12 22:34:16 +02:00
est31
e64de8d90a Remove unused code from a bunch of crates 2019-06-03 04:18:12 +02:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Anshul Malik
a28c642fc7 format components/selectors 2018-09-12 00:24:20 +05:30
Nicholas Nethercote
07ffc0955f
style: Remove use of fnv in bloom.rs.
To support that, this patch also does the following.

- Removes the insert(), remove() and might_contain() methods, because they are
  specialized versions of insert_hash(), remove_hash(), and
  might_contain_hash(), and they are only used by tests within this file.

- Moves hash() from the top level into create_and_insert_some_stuff().

- Changes create_and_insert_some_stuff() so that instead of hashing consecutive
  integers, it instead hashes stringified consecutive integers, which matches
  real usage a little better.

- Raises the false_positives limit a little to account for the above changes.

Bug: 1484096
Reviewed-by: heycam
2018-08-18 17:54:54 +02:00
Nicholas Nethercote
fc9df0bcf3
style: Convert FnvHash{Set,Map} instances to FxHash{Set,Map}.
Bug: 1477628
Reviewed-by: heycam
2018-08-08 01:34:35 +02:00
Xidorn Quan
09b22ab2dc
style: Allow 16% false positives in test bloom::create_and_insert_some_stuff.
It seems that the result of hash algorithm used in bloom filter depends
on the pointer length. On 64bit platforms, there are 135 false positives
in the first part of that test, and 8 in the second part. However, on
32bit platforms, the numbers become 157 and 16 correspondingly.

16 is still less than 20% in the second part, so all fine, but 157 is
slightly larger than 15% in the test assertion. Given it is what we are
shipping, we probably should just accept this and loosen the assertion.

Bug: 1457524
Reviewed-by: heycam
MozReview-Commit-ID: 9kFXBzLFAzE
2018-05-05 16:22:47 +02:00
Bobby Holley
c99bcdd4b8 Run rustfmt on selectors, servo_arc, and style.
This was generated with:

./mach cargo fmt --package selectors &&
./mach cargo fmt --package servo_arc &&
./mach cargo fmt --package style

Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
2018-04-10 17:35:15 -07:00
Simon Sapin
c496aa16a0 Rename the 'unstable' feature of the selectors crate to 'bench' 2017-10-12 17:19:02 +02:00
Cameron McCormack
b23f947d77 selectors: Add a simple Debug impl for CountingBloomFilter. 2017-08-09 19:27:49 +08:00
Cameron McCormack
df2c8b2902 selectors: Add a non-counting Bloom filter type. 2017-08-09 19:27:48 +08:00
Cameron McCormack
e294372a32 selectors: Genericize BloomFilter so we can easily define a non-counting version. 2017-08-09 19:27:47 +08:00
Matt Wismer
288143fadf Correct bloom hash bitpacking documentation
The two 12 bit keys add to 24 bits, which leaves 8 bits free in each word. (And 8 * 3 = 24, to pack in the fourth hash.)
2017-06-22 21:26:14 -04:00
Bobby Holley
71e76a054d Be smarter when clearing the bloom filter. 2017-06-21 19:53:16 -07:00
Bobby Holley
28c35ac9df Improve bloom microbenchmarks.
The current code is mostly bechmarking Rust's default hash routines for
integers, which is not interesting to us. We add generating function
that jumps around "enough" and also add benchmarks for clear().

It's hard to read too much into the numbers because we can't reliably
simulate L1/L2 cache behavior with cargo bench, but the results show
about 40ns for clear() about 2ns for insert, and about 1.5ns for
contains/remove. This informs our thinking in the next patch.
2017-06-21 19:53:15 -07:00
Bobby Holley
5b857686e2 Make selectors benchmark tests work again. 2017-06-21 19:53:15 -07:00
Bobby Holley
cf982d17b9 Shift by KEY_SIZE instead of something larger.
Currently all Gecko and Servo do the KEY_SHIFT thing, but there's no reason
we need to follow that here.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1371949#c10

MozReview-Commit-ID: CqNi7r9e5s0
2017-06-12 12:12:39 -07:00
Emilio Cobos Álvarez
65ebbb7c56
selectors: Unbust tests, and add a way to override the hash for the bloom filter. 2017-04-08 02:00:31 +02:00
Bobby Holley
8915e53cee Move rust-selectors in-tree. 2017-02-07 22:53:10 -08:00