'Compare the speed of object creation to raw protobufs.'

def testObjectCreation(self):

    test_proto = knowledge_base_pb2.User(**self.USER_ACCOUNT)
    test_proto = test_proto.SerializeToString()
    def RDFStructCreateAndSerialize():
        s = rdf_client.User(**self.USER_ACCOUNT)
        s.SerializeToString()
    def RDFStructCreateAndSerializeSetValue():
        s = rdf_client.User()
        for (k, v) in self.USER_ACCOUNT.iteritems():
            setattr(s, k, v)
        s.SerializeToString()
    def RDFStructCreateAndSerializeFromProto():
        s = rdf_client.User.FromSerializedString(test_proto)
        s.SerializeToString()
    def ProtoCreateAndSerialize():
        s = knowledge_base_pb2.User(**self.USER_ACCOUNT)
        s.SerializeToString()
    def ProtoCreateAndSerializeSetValue():
        s = knowledge_base_pb2.User()
        for (k, v) in self.USER_ACCOUNT.iteritems():
            setattr(s, k, v)
        s.SerializeToString()
    def ProtoCreateAndSerializeFromProto():
        s = knowledge_base_pb2.User()
        s.ParseFromString(test_proto)
        self.assertEqual(s.SerializeToString(), test_proto)
    self.TimeIt(RDFStructCreateAndSerialize, 'SProto    Create    from    keywords    and    serialize.')
    self.TimeIt(RDFStructCreateAndSerializeSetValue, 'SProto    Create,    Set    And    Serialize')
    self.TimeIt(RDFStructCreateAndSerializeFromProto, 'SProto    from    serialized    and    serialize.')
    self.TimeIt(ProtoCreateAndSerialize, 'Protobuf    from    keywords    and    serialize.')
    self.TimeIt(ProtoCreateAndSerializeSetValue, 'Protobuf    Create,    Set    and    serialize')
    self.TimeIt(ProtoCreateAndSerializeFromProto, 'Protobuf    from    serialized    and    serialize.')
