D-Programming-Language/phobos — pull request #1579 by monarchdodra (2013-09-15 19:48:52+00:00)
Title: char overloads for std.ascii

This adds (un-documented) `char` overloads in `std.ascii`, for performance reasons.

The point of these overloads is that whenever a user calls the function on a "pure" ascii string (`ubyte[]`), or on codeunits (`char`), then the implementation can statically exploit the reduced range of the type. I increased the `_ctype`'s table size from `128` to `256`. With this, it becomes un-necessary to check if the character is smaller thatn `0x7F`, and instead, straight up index the table, regardless of `c`'s value.

This change provided "noticeable" performance improvement. Measuring was a bit hard, and the results "finicky", but overall, things were always better in a range of anywhere from 10% faster to 60% faster. Nice to take I say.