improvement: speed up output judging#159
Conversation
|
但我不确定代码是不是完全正确 |
|
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