improve serialization speed