Hacker News new | past | comments | ask | show | jobs | submit login

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: