Commit 2f8d2ad
committed
perf: cache resolved indexed directories to avoid repeated resolution
Made the `dirs` variable in `defaultIndexedDirectory()` static const so
that `getResolvedIndexedDirectories()` is only called once. This avoids
redundant directory resolution on every invocation of the default indexed
directory lookup.
将`defaultIndexedDirectory()`中的`dirs`变量声明为static const,
使`getResolvedIndexedDirectories()`仅被调用一次,避免每次查找默认
索引目录时重复进行目录解析。
Log: 缓存已解析的索引目录避免重复解析
PMS: https://pms.uniontech.com/bug-view-361809.html
Influence: 减少重复调用时的冗余文件系统操作,提升频繁查询默认索引目录的搜索场景性能。需确认应用重启后仍能正确加载索引目录配置变更,以及静态初始化不存在线程安全问题。1 parent 27fe7a5 commit 2f8d2ad
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
517 | | - | |
| 517 | + | |
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| |||
0 commit comments