-
Notifications
You must be signed in to change notification settings - Fork 57
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
improvement: speed up output judging #159
improvement: speed up output judging #159
Conversation
但我不确定代码是不是完全正确 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前是真的没想到这里会成为瓶颈
Seems that |
Maybe because it uses UTF-16, it is a variable-length encode. But std::string use no encoding, it will much faster when seek string. |
|
This is expected. There are several operations where |
OLE是怎么判的? |
之前好像没判,现在的话直接 https://doc.qt.io/qt-5/qfile.html#size 或者 https://zh.cppreference.com/w/cpp/filesystem/file_size 应该就好 |
这样,行尾空格和文尾换行直接OLE了 |
其实主要问题在于OLE本身就没有一个判断标准,究竟要不要只考虑有效输出 |
我觉得 OLE 更多的是防止搞事用的,只不过必须得有一个错误类型,所以才有了 OLE |
重写了一下,4MB大小时间从22s提升到了0.04s