Skip to content

Commit

Permalink
Slimmify BTree by replacing its internal Node type, which previously……
Browse files Browse the repository at this point in the history
…held three separately allocated `Vec`s, with a manually allocated buffer. Additionally, restructure the node and stack interfaces to be safer and require fewer bounds checks.

Before:
test btree::map::bench::find_rand_100                      ... bench:        35 ns/iter (+/- 2)
test btree::map::bench::find_rand_10_000                   ... bench:        88 ns/iter (+/- 3)
test btree::map::bench::find_seq_100                       ... bench:        36 ns/iter (+/- 1)
test btree::map::bench::find_seq_10_000                    ... bench:        62 ns/iter (+/- 0)
test btree::map::bench::insert_rand_100                    ... bench:       157 ns/iter (+/- 8)
test btree::map::bench::insert_rand_10_000                 ... bench:       413 ns/iter (+/- 8)
test btree::map::bench::insert_seq_100                     ... bench:       272 ns/iter (+/- 10)
test btree::map::bench::insert_seq_10_000                  ... bench:       369 ns/iter (+/- 19)
test btree::map::bench::iter_1000                          ... bench:     19049 ns/iter (+/- 740)
test btree::map::bench::iter_100000                        ... bench:   1916737 ns/iter (+/- 102250)
test btree::map::bench::iter_20                            ... bench:       424 ns/iter (+/- 40)

After:
test btree::map::bench::find_rand_100                      ... bench:         9 ns/iter (+/- 1)
test btree::map::bench::find_rand_10_000                   ... bench:         8 ns/iter (+/- 0)
test btree::map::bench::find_seq_100                       ... bench:         7 ns/iter (+/- 0)
test btree::map::bench::find_seq_10_000                    ... bench:         8 ns/iter (+/- 0)
test btree::map::bench::insert_rand_100                    ... bench:       136 ns/iter (+/- 5)
test btree::map::bench::insert_rand_10_000                 ... bench:       380 ns/iter (+/- 34)
test btree::map::bench::insert_seq_100                     ... bench:       255 ns/iter (+/- 8)
test btree::map::bench::insert_seq_10_000                  ... bench:       364 ns/iter (+/- 10)
test btree::map::bench::iter_1000                          ... bench:     19112 ns/iter (+/- 837)
test btree::map::bench::iter_100000                        ... bench:   1911961 ns/iter (+/- 33069)
test btree::map::bench::iter_20                            ... bench:       453 ns/iter (+/- 37)
  • Loading branch information
Jonathan S committed Dec 12, 2014
1 parent b25e100 commit 130fb08
Show file tree
Hide file tree
Showing 3 changed files with 1,476 additions and 493 deletions.

5 comments on commit 130fb08

@bors
Copy link
Contributor

@bors bors commented on 130fb08 Dec 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from Gankro
at gereeter@130fb08

@bors
Copy link
Contributor

@bors bors commented on 130fb08 Dec 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging gereeter/rust/slimmer-btree-node = 130fb08 into auto

@bors
Copy link
Contributor

@bors bors commented on 130fb08 Dec 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gereeter/rust/slimmer-btree-node = 130fb08 merged ok, testing candidate = a592124

@bors
Copy link
Contributor

@bors bors commented on 130fb08 Dec 12, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = a592124

Please sign in to comment.