Created by: yihuaxu
As the description of Issue#21266, it shows that the performance of Chinese_NER will be degressive after fixed some TLS section issue. To avoid the string as the key can be helpful the performance.
resolve #21266
CPU: Intel(R) Xeon(R) Gold 6248 CPU @ 2.50GHz Command:
I. ./paddle/fluid/inference/tests/api/test_analyzer_ner --infer_model=third_party/inference_demo/chinese_ner/model --infer_data=third_party/inference_demo/chinese_ner/data.txt --gtest_filter=Analyzer_Chinese_ner.profile --batch_size=1 --repeat=2000 --num_threads=1 --test_all_data=true
II. python chinese_ner_ce.py (changed repeat_times as 1000000 in chinese_ner_ce.py)
Tables:
I. Use Command I
Command I | ||
---|---|---|
Mode | Latency(ms) | Percentage |
Original | 0.0731486 | 0.00% |
Fix TLS issue | 0.085967 | -17.52% |
Improve performance(unordered_map) | 0.0773406 | -5.73% |
Improve performance(map) | 0.0754822 | -3.19% |
- Use Command II with repeat_times=1000
Command II | ||
---|---|---|
Mode | Latency(ms) | Percentage |
Original | 0.09608269 | 0.00% |
Fix TLS issue | 0.12087822 | -25.81% |
Improve performance(unordered_map) | 0.105142593 | -9.43% |
Improve performance(map) | 0.1039505 | -8.19% |
- Use Command II with repeat_times=1000000
Command II | ||
---|---|---|
Mode | Latency(ms) | Percentage |
Original | 0.10085106 | 0.00% |
Fix TLS issue | 0.12207031 | -21.04% |
Improve performance(unordered_map) | 0.10585785 | -4.96% |
Improve performance(map) | 0.105142593 | -4.26% |