def encode(n, proto_factory=TBinaryProtocolFactory()):
    ab = make_addressbook()
    start = time.time()
    for i in range(n):
        serialize(ab, proto_factory)
    end = time.time()
    print('encode\t-> {}'.format((end - start)))
def encode(n, proto_factory=TBinaryProtocolFactory()):
    ab = make_addressbook()
    start = time.time()
    for i in range(n):
        serialize(ab, proto_factory)
    end = time.time()
    print('encode\t-> {}'.format((end - start)))