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

异步输出时的效率和完整性问题 #140

Open
7zly opened this issue Jun 6, 2023 · 0 comments
Open

异步输出时的效率和完整性问题 #140

7zly opened this issue Jun 6, 2023 · 0 comments

Comments

@7zly
Copy link

7zly commented Jun 6, 2023

1.使用Easylogger测试了一天,发现在高频率打印日志,如使用for循环一直打印的情况下,会大量地丢失日志,并且到一定数量之后就不再打印了(和ELOG_ASYNC_OUTPUT_BUF_SIZE有关)。

2.在最高异步等级ELOG_ASYNC_OUTPUT_LVL设置为ELOG_LVL_ASSERT的情况下,用for循环打印1000万条日志,如果调用的是Assert等级,就只能打印几万条日志,调用Info等级,可以打印几十万到百万条日志。但按理来说这俩应该是一样的水平。

3.异步输出时是否可以将需要打印的日志放入缓冲区,等待一定时间或缓冲区满再写入文件。来一条日志就让写入线程对文件进行读写的磁盘io开销过大,批量写入往往可以解决日志库的性能瓶颈。现在的缓冲输出和异步输出是不兼容的,是否可以结合一下。

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