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

性能优化讨论 #295

Open
ZhangChaoWN opened this issue Sep 29, 2024 · 0 comments
Open

性能优化讨论 #295

ZhangChaoWN opened this issue Sep 29, 2024 · 0 comments

Comments

@ZhangChaoWN
Copy link

在使用过程中发现两个优化点,可显著提升性能,尤其在数据量大的情况下:

  1. 在 TaskRunThread.java 中,将 toSendList 从 LinkedList 修改为 HashSet,将 remove 操作的复杂度从 O(n) 降至 O(1)。推送任务执行完成后,保存结果阶段会进行大量的 remove 操作,实测显示性能提升显著。
  2. 在 ImportByFile.java 中,将单条数据依次插入修改为批量插入。实测中,导入几十万条数据的耗时从几十分钟减少至几十秒。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant