def testRepeatedFields(self):

    repeats = self.REPEATS / 50

    def ProtoCreateAndSerialize():
      s = jobs_pb2.MessageList()
      for i in range(self.REPEATS):
        s.job.add(session_id="test", name="foobar", request_id=i)

      return len(s.SerializeToString())

    def RDFStructCreateAndSerialize():
      s = FastGrrMessageList()

      for i in range(self.REPEATS):
        s.job.Append(session_id="test", name="foobar", request_id=i)

      return len(s.SerializeToString())

    self.TimeIt(RDFStructCreateAndSerialize, "RDFStruct Repeated Fields",
                repetitions=repeats)

    self.TimeIt(ProtoCreateAndSerialize, "Protobuf Repeated Fields",
                repetitions=repeats)

    # Check that we can unserialize a protobuf encoded using the standard
    # library.
    s = jobs_pb2.MessageList()
    for i in range(self.REPEATS):
      s.job.add(session_id="test", name="foobar", request_id=i)

    serialized = s.SerializeToString()
    unserialized = FastGrrMessageList(serialized)
    self.assertEqual(len(unserialized.job), len(s.job))

    self.assertEqual(unserialized.job[134].session_id, "test")
    self.assertEqual(unserialized.job[100].request_id, 100)
migrate the document following the migration_handler rules
dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/benchmark_test.py/RDFValueBenchmark.testRepeatedFields--crossover with--dataset/ETHPy150Open namlook/mongokit/mongokit/document.py/Document.migrate