Faster unhexlify
authorTom Jackson <tjackson@fb.com>
Fri, 18 Nov 2016 02:14:14 +0000 (18:14 -0800)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Fri, 18 Nov 2016 02:24:27 +0000 (18:24 -0800)
commitace896f3443632b94fdad46cb5104a377cd5e4fe
treee81fe2ce0c796452924ac27ddfa4665eb0e38c58
parentbe0254f343c83fd05fb5efefd9894821f59e1c77
Faster unhexlify

Summary:
Using already-available lookup table instead of a bunch of branching, this improves read throughput from ~750MB/s to 2.1GB/s in benchmarks.

```
before:        (time)   (rate)
BM_unhexlify   1.39ns  719.26M
after:
BM_unhexlify 470.59ps    2.13G
```

Reviewed By: philippv

Differential Revision: D4201352

fbshipit-source-id: 8393e066c45c402ccb8b537fdb25417e8e6a9511
folly/String-inl.h
folly/test/StringBenchmark.cpp