improve map serialize performance