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

解决超长文本过滤器持续挤占CPU资源问题 #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mole422
Copy link

@mole422 mole422 commented Nov 11, 2024

感谢作者的回答,您说的是正确的,我的确是将超长文本按固定大小分块,并利用多线程并行处理每个分块最后处理完进行合并的方法去解决这个问题,确实可以大幅提高敏感词过滤的效率原来的处理时间如下图1
image
优化后的处理时间如下图2
image
但是忽略了避免提前将多线程等复杂度引入到核心基础组件这个问题,这意味着在项目的初期阶段,应该避免使用复杂的多线程技术,以保持核心组件的简洁和稳定性。后续我会再思考一下这个问题,再次感谢

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

Successfully merging this pull request may close these issues.

1 participant