Mime sniffer: reduce table from 256 bytes to 4
The lookup table for sniffing text/plain messages for binary characters was 256 bytes in size. The information it encoded could be stored in 32 bits. Use a 32-bit lookup table instead of the 256-byte lookup table. This reduces binary size. This change is mostly performance neutral; micro-benchmarks show no statistically significant change on Android. Micro-benchmarks on high-performance Intel processors show an additional cost of around 400ns, apparently due to branch mis-prediction. However, real-world performance is likely to be dominated by the time taken to load the table into CPU cache, which the new implementation should win easily. Also add a micro-benchmark test. BUG= TEST=net_unittests Review URL: https://codereview.chromium.org/1058003005 Cr-Commit-Position: refs/heads/master@{#330577}
Showing
Please register or sign in to comment