Commit Graph

4 Commits

Author SHA1 Message Date
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
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