optimize event_record event_replay