Closed taloric closed 1 month ago
测试结果:
process_roots
与 process_leafs
双重连接,修改前消耗:
real_time: 2024-09-11 10:05:25
start_time: 2024-09-11 10:05:00, end_time: 2024-09-11 10:23:00
cost: 457.8415722846985 s
len(result['DATA']['tracing']): 8000
connect_process_and_networks time: 369.36000752449036
修改后:
```text
real_time: 2024-09-11 10:05:25
start_time: 2024-09-11 10:05:00, end_time: 2024-09-11 10:23:00
cost: 13.16390872001648 s
len(result['DATA']['tracing']): 8000
connect_process_and_networks time: 2.6919126510620117
spring-boot-demo
,82个 span,会发生多次连接修改前:
real_time: 2024-09-11 13:11:50
start_time: 2024-09-11 13:09:50, end_time: 2024-09-11 13:13:50
cost: 10.657386779785156 s
len(result['DATA']['tracing']): 82
connect_process_and_networks time: 0.13371014595031738
修改后:
real_time: 2024-09-11 13:11:50
start_time: 2024-09-11 13:09:50, end_time: 2024-09-11 13:13:50
cost: 8.954121589660645 s
len(result['DATA']['tracing']): 82
connect process and network cost time: 0.0021207332611083984
grpc-demo
,111 个 span
修改前:real_time: 2024-09-11 14:34:40
start_time: 2024-09-11 14:32:40, end_time: 2024-09-11 14:36:40
cost: 3.981588363647461 s
len(result['DATA']['tracing']): 111
connect_process_and_networks cost time: 0.02313542366027832
修改后:
real_time: 2024-09-11 14:34:40
start_time: 2024-09-11 14:32:40, end_time: 2024-09-11 14:36:40
cost: 3.298126220703125 s
len(result['DATA']['tracing']): 111
connect process and network cost time: 0.0023322105407714844
总结:对于大数据集,提升明显,对于小数据集,也略有收益
数据集 | 测试对象 | 修改前 | 修改后 | 总体提升 |
---|---|---|---|---|
8000 span | 整体耗时 | 457.8415722846985 s | 13.16390872001648 s | 97% |
82 span | 整体耗时 | 10.657386779785156 s | 8.954121589660645 s | 15% |
111 span | 整体耗时 | 3.981588363647461 s | 3.298126220703125 s | 17% |
8000 span | connect_process_and_networks 耗时 | 369.36000752449036 | 2.6919126510620117 | 99% |
82 span | connect_process_and_networks 耗时 | 0.13371014595031738 | 0.0021207332611083984 | 98% |
111 span | connect_process_and_networks 耗时 | 0.02313542366027832 | 0.0023322105407714844 | 89% |
connect_process_and_networks
func costrelated_flow_index_map
to optimize O(n^2) loop scan_id IN(x)
instead of_id IN(xx) and _id IN(xx)
to optimize query performancerelated_types
connect_process_and_networks
函数related_flow_index_map
来优化原有的 O(n^2) 扫描,减少扫描量_id in (xx)
而不是多个_id in (xx) and _id in (xx)
来提升查询效果