'Test performance of decode/encode cycle.'

def testDecodeEncode(self):

    s = jobs_pb2.GrrMessage(name=u'foo', request_id=1, response_id=1, session_id=u'session')
    data = s.SerializeToString()
    def ProtoDecodeEncode():
        new_s = jobs_pb2.GrrMessage()
        new_s.ParseFromString(data)
        new_s.SerializeToString()
    def RDFStructDecodeEncode():
        new_s = StructGrrMessage.FromSerializedString(data)
        new_s.SerializeToString()
    self.TimeIt(RDFStructDecodeEncode)
    self.TimeIt(ProtoDecodeEncode)
