-
Notifications
You must be signed in to change notification settings - Fork 301
Commit 2a10eac
committed
Auto merge of #451 - JustForFun88:speed_up_resize_inner, r=Amanieu
Slightly speed up the `resize_inner` function + documentation of other functions.
This speeds up the `resize_inner` function a bit, since now reading the data from the heap is done not by byte, but by a group. In addition, we may not iterate over all control bytes if we have yielded all indexes of full buckets. For example, on my computer:
Before (with `cargo bench`):
```
test grow_insert_ahash_highbits ... bench: 32,481 ns/iter (+/- 5,315)
test grow_insert_ahash_random ... bench: 30,122 ns/iter (+/- 5,568)
test grow_insert_ahash_serial ... bench: 34,267 ns/iter (+/- 8,364)
test grow_insert_std_highbits ... bench: 54,410 ns/iter (+/- 5,030)
test grow_insert_std_random ... bench: 52,566 ns/iter (+/- 6,455)
test grow_insert_std_serial ... bench: 51,681 ns/iter (+/- 9,595)
```
After (with `cargo bench`):
```
test grow_insert_ahash_highbits ... bench: 27,597 ns/iter (+/- 1,436)
test grow_insert_ahash_random ... bench: 27,096 ns/iter (+/- 203)
test grow_insert_ahash_serial ... bench: 27,369 ns/iter (+/- 719)
test grow_insert_std_highbits ... bench: 50,399 ns/iter (+/- 449)
test grow_insert_std_random ... bench: 44,495 ns/iter (+/- 7,180)
test grow_insert_std_serial ... bench: 47,735 ns/iter (+/- 7,598)
```
As for the documentation, I started with `resize_inner` and since this function depends on others, I had to document them as well, etc., so there a lot of documentation in total. Also fixed a couple of inaccuracies with marking the function as unsafe.
Fix #453.1 file changed
+398
-38
lines changed
0 commit comments