[GH-ISSUE #415] Fix slowdown in new version #178

Closed
opened 2026-06-08 11:26:01 +03:00 by zhus · 4 comments
Owner

Originally created by @bootandy on GitHub (Jul 17, 2024).
Original GitHub issue: https://github.com/bootandy/dust/issues/415

Tests with hyperfine show that this PR means we are running ~ 40% slower than the v1.0.0 release.

https://github.com/bootandy/dust/pull/399

Originally created by @bootandy on GitHub (Jul 17, 2024). Original GitHub issue: https://github.com/bootandy/dust/issues/415 Tests with hyperfine show that this PR means we are running ~ 40% slower than the v1.0.0 release. https://github.com/bootandy/dust/pull/399
zhus closed this issue 2026-06-08 11:26:01 +03:00
Author
Owner

@bootandy commented on GitHub (Jul 17, 2024):

Ok, I've traced the problem down to 2 places.

If no filters are entered we always apply this filter: - meaning we always have to check it which we never did before
None => (Operater::GreaterThan, 0),

The Moving of this line down a bit in dir_walker.rs (it is needed because having it is faster than a file lookup).
if !walk_data.allowed_filesystems.is_empty()

<!-- gh-comment-id:2231969981 --> @bootandy commented on GitHub (Jul 17, 2024): Ok, I've traced the problem down to 2 places. If no filters are entered we always apply this filter: - meaning we always have to check it which we never did before ` None => (Operater::GreaterThan, 0),` The Moving of this line down a bit in dir_walker.rs (it is needed because having it is faster than a file lookup). `if !walk_data.allowed_filesystems.is_empty()`
Author
Owner

@bootandy commented on GitHub (Jul 17, 2024):

https://github.com/bootandy/dust/pull/417

<!-- gh-comment-id:2231979671 --> @bootandy commented on GitHub (Jul 17, 2024): https://github.com/bootandy/dust/pull/417
Author
Owner

@wugeer commented on GitHub (Jul 17, 2024):

Ok, I've traced the problem down to 2 places.

If no filters are entered we always apply this filter: - meaning we always have to check it which we never did before , which we've never done before None => (Operater::GreaterThan, 0),

The Moving of this line down a bit in dir_walker.rs (it is needed because having it is faster than a file lookup). It's faster than file lookup). if !walk_data.allowed_filesystems.is_empty()

Yes, you are right. I'm sorry that this PR of mine caused the performance to drop so much. I will revisit the performance of my code!

<!-- gh-comment-id:2232117117 --> @wugeer commented on GitHub (Jul 17, 2024): > Ok, I've traced the problem down to 2 places. > > If no filters are entered we always apply this filter: - meaning we always have to check it which we never did before , which we've never done before `None => (Operater::GreaterThan, 0),` > > The Moving of this line down a bit in dir_walker.rs (it is needed because having it is faster than a file lookup). It's faster than file lookup). `if !walk_data.allowed_filesystems.is_empty()` Yes, you are right. I'm sorry that this PR of mine caused the performance to drop so much. I will revisit the performance of my code!
Author
Owner

@bootandy commented on GitHub (Jul 17, 2024):

No problem, We live and learn. I should have checked more.

<!-- gh-comment-id:2233998342 --> @bootandy commented on GitHub (Jul 17, 2024): No problem, We live and learn. I should have checked more.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#178