ec = EncoderClient("100.102.33.53")
// encode a list of strings
with open("sample_text.txt", encoding="utf8") as fp:
data = fp.readlines() * 20
while True:
start_t = time.time()
After Change
ec = EncoderClient("100.102.33.53")
// encode a list of strings
with open("sample_text.txt", encoding="utf8") as fp:
data = fp.readlines()
for j in range(1, 200, 10):
start_t = time.time()
ec.encode(data * j)
time_t = time.time() - start_t
print("encoding %d strs in %.3fs, speed: %d/s" %
(len(data * j), time_t, int(len(data * j) / time_t)))
// bad example: encode a string
// print(ec.encode("abc"))