Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬你好,程序执行效率是否有优化空间呢 #359

Closed
yongheng66 opened this issue Oct 3, 2024 · 2 comments
Closed

大佬你好,程序执行效率是否有优化空间呢 #359

yongheng66 opened this issue Oct 3, 2024 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@yongheng66
Copy link

我看了action执行一次花了29分钟,资源获取和测速排序花了很长时间,2千个资源基本一个个串联处理的,Python是否有像java一样的多线程机制呢,数据分多个任务并行处理,以提升执行效率。提个小小的建议,看看大佬能否优化,谢谢!

@Guovin
Copy link
Owner

Guovin commented Oct 3, 2024

你看到的日志输出并不代表是串联处理,本程序采用多线程异步并行实现,实际情况是十或几十个接口同时在运行,结果信息日志分别返回。通过多个版本迭代,已经兼顾到大多数机器性能。你看到的2千个接口并不代表实际所有的接口,而是已经过滤了可通过缓存的无需运行、可合并测速结果的接口数量。因为部分接口需要采用FFmpeg方式进行测速获取分辨率信息,并行数量不易过大,否则会影响获取接口真实的状态,造成偏差。所以目前已经权衡多种情况,在不影响机器正常工作以及接口验效的前提下,执行效率已经达到比较理想的状态了。

@Guovin Guovin added the help wanted Extra attention is needed label Oct 3, 2024
@yongheng66
Copy link
Author

OK,我不懂Python,大概了解了,感谢分享!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants