Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
感谢作者的回答,您说的是正确的,我的确是将超长文本按固定大小分块,并利用多线程并行处理每个分块最后处理完进行合并的方法去解决这个问题,确实可以大幅提高敏感词过滤的效率原来的处理时间如下图1
优化后的处理时间如下图2
但是忽略了避免提前将多线程等复杂度引入到核心基础组件这个问题,这意味着在项目的初期阶段,应该避免使用复杂的多线程技术,以保持核心组件的简洁和稳定性。后续我会再思考一下这个问题,再次感谢