Commit Graph

5 Commits

Author SHA1 Message Date
Jun Wu
3408c53051 vlqencoding: replace criterion with minibench
Summary: Similar with D7440249. See D7440254 for motivation.

Reviewed By: DurhamG

Differential Revision: D7562196

fbshipit-source-id: e90c623bd9576de49c3d4990ac93c105238d219c
2018-04-17 18:54:39 -07:00
Jun Wu
c114d2499b vlqencoding: add read_vlq_at API that works for AsRef<[u8]>
Summary:
This allows us to decode VLQ integers at a given offset, for anything that
implements `AsRef<[u8]>`. Instead of having to couple with a `&mut Read`
interface. The main benefit is to get rid of `mut`. The old `VLQDecode`
interface has to use `&mut Read` since reading has a side effect of changing
the internal position counter.

Reviewed By: markbt

Differential Revision: D7093998

fbshipit-source-id: 20cb14e38c828462c34f32245d0f0f512028b647
2018-04-13 21:51:19 -07:00
Jun Wu
e266793816 vlqencoding: add a benchmark
Summary:
I'm going to add more ways to do VLQ parsing (ex. reading from a `&[u8]`
instead of a `Read` which has to be mutable). So let's add a benchmark to
compare the `&[u8]` version with the `Read` version.

Reviewed By: DurhamG

Differential Revision: D7092960

fbshipit-source-id: e1189de10396516c732dc73b45b7690a1718f1c0
2018-04-13 21:51:19 -07:00
Jun Wu
f547ef9ed0 rust: vendor more crates
Summary:
criterion provides useful utilities for writing benchmarks.
fs2 provides cross-platform file locking.
memmap provides cross-platform mmap.
atomicwrites provides cross-platform atomic file rewrite.
twox-hash provides xxHash fast hash algorithm for integrity check usecase.

Reviewed By: singhsrb

Differential Revision: D7092764

fbshipit-source-id: a3a2a31c198e73701708d7124574ba447ab99c45
2018-04-13 21:51:19 -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