use a more efficient mechanism for parsing numbers, inspired by rapidjson