Commit Graph

11 Commits

Author SHA1 Message Date
Jun Wu
69a6c18747 indexedlog: normalize benchmarks to use 204800 entries
Summary:
This makes it easier to compare benchmark results between abstractions.

A sample of the result is listed below. Comparing to radixbuf, which is highly
optimized and less flexible, indexedlog is about 10x slower on insertion, and
about 3x slower on lookup.

indexedlog:

  index insertion (owned key)    90.201 ms
  index insertion (referred key) 81.567 ms
  index flush                    50.285 ms
  index lookup (memory)          25.201 ms
  index lookup (disk, no verify) 31.325 ms
  index lookup (disk, verified)  46.893 ms

  log insertion                  18.421 ms
  log insertion (no checksum)    12.106 ms
  log insertion with index      110.143 ms
  log flush                       8.783 ms
  log iteration (memory)          6.444 ms
  log iteration (disk)            6.719 ms

raidxbuf:

  index insertion                11.874 ms
  index lookup                    8.495 ms

Differential Revision: D14635330

fbshipit-source-id: 28b3f33b87f4e882cb3839c37a2a11b8ac80d3e9
2019-03-27 16:29:58 -07:00
Jun Wu
08c42a9e06 radixbuf: fix cargo bench
Summary: Change the code to work with newer `rand` crate.

Reviewed By: kulshrax

Differential Revision: D14635328

fbshipit-source-id: 007f6749f2eab781a7dcf7d49b19aff1c81089b4
2019-03-27 16:29:58 -07:00
Stefan Filip
06704f2db2 radixbuf: add ignore marker to documentation blocks
Summary:
https://doc.rust-lang.org/rustdoc/documentation-tests.html#syntax-reference

Rust will treat an indentation of 4 or more spaces as a fenced code block and
attempt to run it as a docblock test

Reviewed By: singhsrb

Differential Revision: D14543987

fbshipit-source-id: 92f78e9e052befba0bd3eea80ac171f651f2fced
2019-03-20 19:56:14 -07:00
Stefan Filip
9c90eb2e9c radixbuf: cargo fmt
Summary: Formatting

Reviewed By: singhsrb

Differential Revision: D14543986

fbshipit-source-id: 5aae3a6166c315872102ab90d87d46d782682bc8
2019-03-20 19:56:14 -07:00
Xavier Deguillard
91b1a56c3a radixbuf: make it compile on windows
Summary:
Instead of using the rand crate imported into quickcheck, we can use the
rand crate directly.

Reviewed By: quark-zju

Differential Revision: D14174653

fbshipit-source-id: c848f139765b9e458d374790227399f0ad836af6
2019-02-22 10:22:30 -08:00
Jun Wu
3adc813687 codemod: add copyright headers
Summary: This is just the result of running `./contrib/fix-code.py $(hg files .)`

Reviewed By: ikostia

Differential Revision: D10213075

fbshipit-source-id: 88577c9b9588a5b44fcf1fe6f0082815dfeb363a
2018-10-26 15:09:12 -07:00
Jeremy Fitzhardinge
98be816aba rust/tp2: update rust-crates-io
Summary:
Big change here is update to rand 0.5. This is a significant API
change. quickcheck still uses rand 0.4, so for quickcheck users I changed it so
that quickcheck re-exports the rand it uses. This means that quickcheck users
are unchanged aside from using quickcheck::rand, whereas direct rand users have
been updated to use the new API.

Reviewed By: farnz

Differential Revision: D8234503

fbshipit-source-id: f9e620851b8dfcc33f22a0af26122adcd5fbde39
2018-06-01 09:32:56 -07:00
Jun Wu
00a9659536 radixbuf: replace criterion with minibench
Summary: Similar with D7440249. See D7440254 for motivation.

Reviewed By: DurhamG

Differential Revision: D7562195

fbshipit-source-id: b11eb4f47375a2a2d70be96ebcfe2fefe1e0aaad
2018-04-17 18:54:39 -07:00
Jun Wu
704eef1e4e radixbuf: use criterion for benchmark
Summary:
The old `rustc-test` crate no longer works. There is an upstream
bug report at https://github.com/servo/rustc-test/issues/7.

This change makes it possible to compare radixbuf performance
with the new index.

Reviewed By: DurhamG

Differential Revision: D7404531

fbshipit-source-id: 515e732a65388db4c865c7b139d0f57ead76f788
2018-04-13 21:51:40 -07:00
Jun Wu
c1bebda5d6 radixbuf: avoid using unstable features in buck build
Summary:
`test::Bencher` is an unstable feature, which is enabled by 3rd-party crate
`rustc-test`. However, `rustc-test` does not work with buck build. So let's
workaround that by allowing all usage of `test::Bencher` to be disabled by a
feature. And turn on that feature in buck build. Cargo build will remain
unchanged.

Reviewed By: singhsrb

Differential Revision: D7011703

fbshipit-source-id: e08ba9516bf7fadb6edb52ab107e0172df0aaf5b
2018-04-13 21:51:12 -07:00
Mark Thomas
2e81565606 fb-hgext: integrate rust libraries and extensions with setup.py
Summary:
Move the rust libraries and extensions to their new locations, and integrate
them with the hg-crew setup.py.

Test Plan: Run `python setup.py build` and verify rust extensions are built.

Reviewers: durham, #mercurial

Reviewed By: durham

Subscribers: fried, jsgf, mitrandir

Differential Revision: https://phabricator.intern.facebook.com/D6677251

Tasks: T24908724

Signature: 6677251:1515450235:920faf40babbce9b09e3283ff9ca328d1c5c51e6
2018-01-08 15:26:24 -08:00