8d03c2febfa251625c4d4cab2bc0c642cdd1655e,client_example.py,,,#,25

Before Change


    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"))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: hanxiao/bert-as-service
Commit Name: 8d03c2febfa251625c4d4cab2bc0c642cdd1655e
Time: 2018-11-09
Author: hanhxiao@tencent.com
File Name: client_example.py
Class Name:
Method Name:


Project Name: hanxiao/bert-as-service
Commit Name: 11da992272f0b41f6672f5ff078894282e5bb393
Time: 2018-11-08
Author: hanhxiao@tencent.com
File Name: client_example.py
Class Name:
Method Name:


Project Name: hanxiao/bert-as-service
Commit Name: 7dc7f7b84bcaeb21fa5f993c018b86b2ba662550
Time: 2018-11-09
Author: hanhxiao@tencent.com
File Name: client_example.py
Class Name:
Method Name: