Project io: Improve the performance to read a char

1. Precompile the match pattern for a character instead of compiling the
match pattern every time the function is called.

2. Add a test case that analyzes the performance of
reading a char in TestInputParser.