Improve performance of json_encode().