Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
glandium
on Oct 14, 2021
|
parent
|
context
|
favorite
| on:
A Tale of Two Optimisations
clang does something smart with the switch, equivalent to this C code:
unsigned char lookup2_encode(const unsigned char dibit) { return ' \r\n\t' >> (dibit * 8); }
I'd expect that to be faster just from having the lookup table in the code itself, and not having to use a different cache line from the data segment (as well as avoiding pointer indirection).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: