refactor: Optimize log file reading logic#11064
refactor: Optimize log file reading logic#11064wanghe-fit2cloud merged 3 commits into1Panel-dev:dev-v2from
Conversation
…rove pagination logic
…and constant usage
|
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What this PR does / why we need it?
优化日志读取算法
Summary of your change
ReadFileByLine 用环形缓冲队列来统计行,而不是全读一遍。减少一遍全量读写
TailFromEnd 直接后插,最后再翻转过来,减少每次前插的内存开销。
使用sync.pool而不是循环new来麻烦GC
Please indicate you've done the following: