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

log文件输出时不时会开销巨大 #465

Open
xiaoqiangCai opened this issue Jul 8, 2024 · 1 comment
Open

log文件输出时不时会开销巨大 #465

xiaoqiangCai opened this issue Jul 8, 2024 · 1 comment
Labels
改进 New feature or request

Comments

@xiaoqiangCai
Copy link

如题,实测发现,单单输出这句write代码就会耗时16ms甚至64ms,不稳定出现,但是频率不低


if self.usedSize > self.maxSize then
        self.file:write('[REACH MAX SIZE]!')
        self.file:close()
        self.file = nil
    else
        self.file:write(fullMessage)
    end

@sumneko
Copy link
Member

sumneko commented Jul 8, 2024

这个日志系统的是同步的,write 的时候会有IO开销。以后想办法改成异步的。

@sumneko sumneko added the 改进 New feature or request label Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
改进 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants