release/snipe#351
Conversation
Johnson-zs
commented
Jul 16, 2026
- perf(dfm-io): cache statx results in DFileInfoPrivate::attributesBySelf
- fix: prevent BOM character loss in path concatenation
Introduce ensureStatxCached() to consolidate six independent statx syscalls into one. Cache the result in mutable member fields so that subsequent time-attribute queries reuse the same buffer. 在 attributesBySelf 中引入 ensureStatxCached() 方法,将 6 个时间 属性的重复 statx 系统调用合并为一次,结果缓存后各 case 直接读取。 Log: 优化 attributesBySelf 中 statx 调用,消除重复系统调用 Task: https://pms.uniontech.com/task-view-391003.html Influence: 查询 kTimeCreated/Modified/Access 等属性时,statx 从最多 6 次降为 1 次,减少不必要的系统调用开销。
Use std::string for directory path concatenation to avoid QString's normalization of UTF-8 BOM (U+FEFF / zero-width no-break space). 使用 std::string 进行路径拼接,避免 QString 对 UTF-8 BOM (零宽不换行空格) 的规范化导致字节丢失。 Log: 修复路径拼接时 BOM 字符丢失的问题 Bug: https://pms.uniontech.com//bug-view-367075.html Influence: 修复后包含 BOM/零宽不换行空格的路径能正确拼接,避免文件操作失败。
There was a problem hiding this comment.
Sorry @Johnson-zs, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Johnson-zs 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 |
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 代码已非常完善,无需额外修复。以下为当前优秀代码的保留展示:
bool DFileInfoPrivate::ensureStatxCached() const
{
if (statxCached)
return statxValid;
statxCached = true;
const QUrl &url = q->uri();
if (!url.isLocalFile())
return false;
unsigned mask = STATX_BASIC_STATS | STATX_BTIME;
int ret = statx(AT_FDCWD, url.path().toStdString().data(),
AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT, mask, &statxBuf);
statxValid = (ret == 0);
return statxValid;
} |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
fd494fb
into
linuxdeepin:release/snipe