def testEncodeDecode(self):

    def Check(s, new_s):
      self.assertEqual(s.name, new_s.name)
      self.assertEqual(s.name, u"foo")
      self.assertEqual(s.request_id, new_s.request_id)
      self.assertEqual(s.request_id, 1)
      self.assertEqual(s.response_id, new_s.response_id)
      self.assertEqual(s.response_id, 1)
      self.assertEqual(s.session_id, new_s.session_id)
      self.assertEqual(s.session_id, u"session")

    def ProtoEncodeDecode():
      s = jobs_pb2.GrrMessage(name=u"foo", request_id=1, response_id=1,
                              session_id=u"session")
      data = s.SerializeToString()

      new_s = jobs_pb2.GrrMessage()
      new_s.ParseFromString(data)

      return s, new_s

    def RDFStructEncodeDecode():
      s = StructGrrMessage(name=u"foo", request_id=1, response_id=1,
                           session_id=u"session")
      data = s.SerializeToString()

      new_s = StructGrrMessage(initializer=data)

      return s, new_s

    # Make sure everything is sane first.
    Check(*ProtoEncodeDecode())
    Check(*RDFStructEncodeDecode())

    self.TimeIt(RDFStructEncodeDecode)
    self.TimeIt(ProtoEncodeDecode)
Adds the binding class `cls` to the ``_EXTENSION_MAP``.
dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/benchmark_test.py/RDFValueBenchmark.testEncodeDecode--crossover with--dataset/ETHPy150Open STIXProject/python-stix/stix/bindings/__init__.py/add_extension