optimize dict_to_file