Improve digits_to() performance
Improve digits_to() performance

Summary:
This optimization eliminates about 75% of the multiplications and bounds
checking in the original code by using constant lookup tables to convert
from decical digit to (shifted) binary number, instead of arithmetic.
The total cost of the lookup tables is 2KB of static memory, but the
average throughput gain across the range from 1 to 19 characters is 27%.
The throughput distributes as follows: (in million iters/sec)
Bytes   Orig    New     Speedup
1       101.31  110.12  109%
2       97.42   110.12  113%
3       97.42   105.53  108%
4       79.13   101.31  128%
5       74.48   97.42   131%
6       74.48   93.81   126%
7       70.35   93.81   133%
8       61.77   79.14   128%
9       58.9    72.35   123%
10      58.9    74.48   126%
11      56.28   74.48   132%
12      50.22   64.93   129%
13      48.52   60.3    124%
14      47.74   61.77   129%
15      46.88   61.77   132%
16      42.54   55.06   129%
17      41.51   51.69   125%
18      40.97   52.76   129%
19      39.57   52.76   133%

Test Plan: Passes all unit tests

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D493245

theiver9827/folly,SeanRBurton/folly,sakishum/folly,Eagle-X/folly,chjp2046/folly,gavioto/folly,unmeshvrije/C--,arg0/folly,cppfool/folly,mqeizi/folly,xzmagic/folly,Eagle-X/folly,clearlinux/folly,Eagle-X/folly,SeanRBurton/folly,lifei/folly,rklabs/folly,loverszhaokai/folly,tomhughes/folly,kernelim/folly,KSreeHarsha/folly,KSreeHarsha/folly,clearlinux/folly,guker/folly,PPC64/folly,bikong2/folly,sakishum/folly,bsampath/folly,kernelim/folly,lifei/folly,loversInJapan/folly,fw1121/folly,upsoft/folly,ajtulloch/folly,tempbottle/folly,gaoyingie/folly,raphaelamorim/folly,theiver9827/folly,shaobz/folly,gaoyingie/folly,facebook/folly,alexst07/folly,guker/folly,lifei/folly,doctaweeks/folly,guker/folly,clearlylin/folly,PPC64/folly,unmeshvrije/C--,yangjin-unique/folly,loverszhaokai/folly,sonnyhu/folly,SammyK/folly,bikong2/folly,Orvid/folly,renyinew/folly,stonegithubs/folly,ykarlsbrun/folly,leolujuyi/folly,cppfool/folly,hongliangzhao/folly,Orvid/folly,fw1121/folly,facebook/folly,loversInJapan/folly,clearlylin/folly,loversInJapan/folly,cole14/folly,bsampath/folly,constantine001/folly,ykarlsbrun/folly,bikong2/folly,colemancda/folly,loverszhaokai/folly,leolujuyi/folly,KSreeHarsha/folly,bobegir/folly,renyinew/folly,project-zerus/folly,PoisonBOx/folly,stonegithubs/folly,sakishum/folly,SammyK/folly,floxard/folly,tomhughes/folly,wildinto/folly,project-zerus/folly,KSreeHarsha/folly,ykarlsbrun/folly,zhiweicai/folly,clearlylin/folly,nickhen/folly,renyinew/folly,arg0/folly,Hincoin/folly,SeanRBurton/folly,hongliangzhao/folly,SammyK/folly,gaoyingie/folly,bowlofstew/folly,gavioto/folly,nickhen/folly,Orvid/folly,rklabs/folly,kernelim/folly,wildinto/folly,Hincoin/folly,Hincoin/folly,arg0/folly,charsyam/folly,wildinto/folly,Orvid/folly,brunomorishita/folly,cole14/folly,PoisonBOx/folly,bikong2/folly,project-zerus/folly,romange/folly,tempbottle/folly,upsoft/folly,fw1121/folly,upsoft/folly,CJstar/folly,guker/folly,reddit/folly,sonnyhu/folly,xzmagic/folly,arg0/folly,zhiweicai/folly,alexst07/folly,yangjin-unique/folly,doctaweeks/folly,unmeshvrije/C--,nickhen/folly,cppfool/folly,Hincoin/folly,mqeizi/folly,gavioto/folly,cppfool/folly,rklabs/folly,raphaelamorim/folly,romange/folly,tempbottle/folly,mqeizi/folly,brunomorishita/folly,sakishum/folly,yangjin-unique/folly,floxard/folly,KSreeHarsha/folly,nickhen/folly,lifei/folly,CJstar/folly,Orvid/folly,tempbottle/folly,floxard/folly,constantine001/folly,doctaweeks/folly,PoisonBOx/folly,clearlinux/folly,SeanRBurton/folly,hongliangzhao/folly,PPC64/folly,cole14/folly,constantine001/folly,renyinew/folly,bsampath/folly,gavioto/folly,cole14/folly,shaobz/folly,nickhen/folly,bsampath/folly,hongliangzhao/folly,CJstar/folly,leolujuyi/folly,ykarlsbrun/folly,bobegir/folly,tomhughes/folly,CJstar/folly,reddit/folly,upsoft/folly,floxard/folly,Eagle-X/folly,facebook/folly,romange/folly,mqeizi/folly,fw1121/folly,ajtulloch/folly,alexst07/folly,wildinto/folly,PPC64/folly,SammyK/folly,guker/folly,xzmagic/folly,facebook/folly,chjp2046/folly,gaoyingie/folly,Eagle-X/folly,leolujuyi/folly,doctaweeks/folly,ykarlsbrun/folly,raphaelamorim/folly,bowlofstew/folly,stonegithubs/folly,bobegir/folly,bikong2/folly,mqeizi/folly,ajtulloch/folly,raphaelamorim/folly,alexst07/folly,tomhughes/folly,loverszhaokai/folly,kernelim/folly,romange/folly,unmeshvrije/C--,shaobz/folly,juniway/folly,unmeshvrije/C--,romange/folly,chjp2046/folly,rklabs/folly,constantine001/folly,sonnyhu/folly,clearlylin/folly,brunomorishita/folly,sonnyhu/folly,renyinew/folly,colemancda/folly,xzmagic/folly,charsyam/folly,yangjin-unique/folly,shaobz/folly,theiver9827/folly,sakishum/folly,colemancda/folly,colemancda/folly,loversInJapan/folly,gavioto/folly,zhiweicai/folly,juniway/folly,clearlinux/folly,PPC64/folly,bowlofstew/folly,cole14/folly,kernelim/folly,cppfool/folly,project-zerus/folly,lifei/folly,tomhughes/folly,brunomorishita/folly,zhiweicai/folly,loverszhaokai/folly,CJstar/folly,facebook/folly,theiver9827/folly,arg0/folly,leolujuyi/folly,clearlylin/folly,juniway/folly,raphaelamorim/folly,PoisonBOx/folly,loversInJapan/folly,fw1121/folly,bowlofstew/folly,reddit/folly,colemancda/folly,constantine001/folly,clearlinux/folly,xzmagic/folly,rklabs/folly,brunomorishita/folly,bowlofstew/folly,bobegir/folly,reddit/folly,project-zerus/folly,Hincoin/folly,stonegithubs/folly,SeanRBurton/folly,juniway/folly,doctaweeks/folly,charsyam/folly,chjp2046/folly,unmeshvrije/C--,bobegir/folly,gaoyingie/folly,zhiweicai/folly,wildinto/folly,tempbottle/folly,bsampath/folly,stonegithubs/folly,SammyK/folly,reddit/folly,PoisonBOx/folly,alexst07/folly,shaobz/folly,sonnyhu/folly,chjp2046/folly,yangjin-unique/folly,floxard/folly,theiver9827/folly,hongliangzhao/folly,charsyam/folly,upsoft/folly,juniway/folly