+
Skip to content

Conversation

jesseschalken
Copy link
Contributor

@jesseschalken jesseschalken commented Nov 3, 2024

On Windows, the DirEntry object has metadata already loaded, so calling dir_entry.metadata() instead of fs::symlink_metadata(path) saves a syscall.

~1.29x speedup on my test directory.

Before

> cargo build --release
> measure-command { .\target\release\coreutils.exe du --apparent-size "test folder" }
TotalSeconds      : 12.0716311

After

> cargo build --release
> measure-command { .\target\release\coreutils.exe du --apparent-size "test folder" }
TotalSeconds      : 9.3127479

@jesseschalken jesseschalken changed the title Use metadata from DirEntry where possible du: Reuse metadata from DirEntry where possible Nov 3, 2024
Copy link

github-actions bot commented Nov 3, 2024

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

@jesseschalken jesseschalken marked this pull request as ready for review November 3, 2024 14:11
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/rm/rm1 (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@cakebaker cakebaker merged commit 3d4436a into uutils:main Nov 19, 2024
62 checks passed
@cakebaker
Copy link
Contributor

Thanks for your PR :)

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

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载