Use string::compare to improve performance.

`string::compare` improves performance of parse because it does not create temporary object.