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

🐞 Bug Report:后台运行时,CPU占用高。 #223

Closed
3 of 4 tasks
skefy opened this issue Nov 16, 2023 · 5 comments
Closed
3 of 4 tasks

🐞 Bug Report:后台运行时,CPU占用高。 #223

skefy opened this issue Nov 16, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@skefy
Copy link

skefy commented Nov 16, 2023

Please confirm the following:

  • I have carefully read the README
  • I have searched through the issues page but couldn't find a solution.(Including issue that has been closed)
  • Easydict has been upgraded to the latest version.

Problem description

感谢开源如此优秀的项目,翻译速度非常棒。

但是在后台运行(没有执行任何翻译动作、没有开启化词翻译等等)时,感觉CPU占用高(在1% ~ 7% 之间变动)。对比欧陆词典在后台,基本都是0.1%的CPU占用。

image image

Reproduction steps

Expected result

Proposed solution (optional)

No response

Device information and OS version

No response

Are you willing to submit a PR to fix this issue?

  • I'm willing to submit a PR!
@skefy skefy added the bug Something isn't working label Nov 16, 2023
Copy link

Hello skefy, Thank you for your first issue contribution 🎉

@Jerry23011
Copy link
Collaborator

Jerry23011 commented Nov 16, 2023

Hi @skefy,感谢反馈
这个是一个正常现象 #110 (comment)

频繁移动光标时,有 CPU 占用是正常的,我这边显示 3% 左右,问题不大,这是因为要实时监测自动划词动作,监听了一些系统的键盘鼠标事件。

CC @tisfeng 可以确认一下

@tisfeng
Copy link
Owner

tisfeng commented Nov 16, 2023

鼠标停止不动的时候也基本不占用 CPU,但项目中很多地方都用到了监控键鼠事件,例如鼠标划词,查询窗口的位置显示等。

这里应该可以稍微优化一下,稍后我看看。欢迎 PR。

image

@tisfeng
Copy link
Owner

tisfeng commented Dec 6, 2023

2.2.0 版本优化一下,CPU 占用大约比之前下降了 20%,效果虽然不是很理想,但也没找到更好的优化方式了。

@tisfeng
Copy link
Owner

tisfeng commented Dec 6, 2023

欢迎 PR 继续优化。

@tisfeng tisfeng closed this as completed Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants