Improve performance for recv_event in ffi binding.