Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sxyazi
Copy link
Owner

@sxyazi sxyazi commented Aug 19, 2025

This PR eliminates the use of Rust's standard library HashMap and HashSet, switching to hashbrown instead, which is around 2x faster.

hashbrown also provides some powerful features, such as the Equivalent trait and the raw_entry() method.

@sxyazi sxyazi requested a review from Copilot August 19, 2025 07:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR switches from Rust's standard library HashMap and HashSet implementations to the hashbrown crate to improve performance. The change affects hash table usage across the entire codebase.

  • Replaces std::collections::{HashMap, HashSet} imports with hashbrown::{HashMap, HashSet}
  • Updates Cargo.toml files to include hashbrown as a dependency
  • Removes foldhash dependency in favor of hashbrown

Reviewed Changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yazi-shared/src/event/data.rs Replaces std HashMap import with hashbrown
yazi-shared/src/event/cmd.rs Replaces std HashMap import with hashbrown
yazi-scheduler/src/prework/prework.rs Replaces std HashMap and HashSet imports with hashbrown
yazi-scheduler/src/ongoing.rs Replaces std HashMap import with hashbrown
yazi-scheduler/src/hooks.rs Replaces std HashMap import with hashbrown
yazi-scheduler/Cargo.toml Adds hashbrown dependency
yazi-plugin/src/loader/loader.rs Replaces std HashMap import with hashbrown
yazi-plugin/Cargo.toml Adds hashbrown dependency
yazi-parser/src/mgr/update_mimes.rs Replaces std HashMap import with hashbrown
yazi-parser/src/app/plugin.rs Replaces std HashMap import with hashbrown
yazi-fs/src/sorter.rs Replaces std HashMap import with hashbrown
yazi-fs/src/op.rs Replaces std HashMap and HashSet imports with hashbrown
yazi-fs/src/mounts/partitions.rs Updates HashSet type annotation to use hashbrown
yazi-fs/src/mounts/linux.rs Replaces std HashMap and HashSet imports with hashbrown
yazi-fs/src/fns.rs Replaces std HashMap and HashSet imports with hashbrown
yazi-fs/src/files.rs Replaces std HashMap and HashSet imports with hashbrown
yazi-fs/Cargo.toml Adds hashbrown dependency
yazi-dds/src/state.rs Replaces std HashMap import with hashbrown
yazi-dds/src/server.rs Replaces std HashMap import with hashbrown and adds explicit type annotation
yazi-dds/src/sendable.rs Replaces std HashMap import with hashbrown
yazi-dds/src/pubsub.rs Consolidates HashMap and HashSet imports under hashbrown
yazi-dds/src/ember/hi.rs Replaces std HashSet import with hashbrown
yazi-dds/src/ember/hey.rs Replaces std HashMap import with hashbrown
yazi-dds/src/ember/bulk.rs Replaces std HashMap import with hashbrown
yazi-dds/src/client.rs Replaces std HashMap and HashSet imports with hashbrown
yazi-core/src/tasks/process.rs Replaces std HashMap import with hashbrown
yazi-core/src/tab/finder.rs Replaces std HashMap import with hashbrown
yazi-core/src/mgr/watcher.rs Replaces std HashMap and HashSet imports with hashbrown
yazi-core/src/mgr/linked.rs Replaces std HashMap import with hashbrown
yazi-core/src/cmp/cmp.rs Replaces std HashMap import with hashbrown
yazi-config/src/theme/icon.rs Replaces std HashMap import with hashbrown
yazi-config/src/plugin/plugin.rs Replaces std HashSet import with hashbrown
yazi-config/src/opener/opener.rs Replaces std HashMap import with hashbrown
yazi-config/src/keymap/rules.rs Replaces std HashSet import with hashbrown
yazi-config/Cargo.toml Adds hashbrown dependency
yazi-boot/src/boot.rs Replaces std HashSet import with hashbrown
yazi-boot/Cargo.toml Adds hashbrown dependency
yazi-binding/src/runtime.rs Replaces std HashMap import with hashbrown
yazi-binding/src/composer.rs Replaces foldhash HashMap with hashbrown
yazi-binding/Cargo.toml Replaces foldhash dependency with hashbrown
yazi-actor/src/mgr/bulk_rename.rs Replaces std HashMap import with hashbrown
yazi-actor/src/lives/lives.rs Replaces foldhash HashMap with hashbrown
yazi-actor/src/lives/file.rs Updates Entry import to use hashbrown
yazi-actor/Cargo.toml Removes foldhash dependency, keeps existing hashbrown

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sxyazi sxyazi merged commit 7a9bfff into main Aug 19, 2025
6 checks passed
@sxyazi sxyazi deleted the pr-1d27cb60 branch August 19, 2025 07:58
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants