Skip to content

Conversation

@Cheong-Lau
Copy link
Contributor

Since we already depend on rustc-hash transiently, this doesn't add any more dependencies. As long as DOS attacks aren't a concern (which I don't think they are?), this should be free performance.

In my (admittedly naive) testing, this really improved CPU usage in some cases, which is pretty nice to get for free.

Also, on a separate note, I would like to work on improving the performance more, but right now I don't actually know how to benchmark properly (cargo-flamegraph is returning nonsense for me?), so I've just been making random changes until performance improved. This is the first change I made that actually did anything meaningful 🫠

Since we already depend on `rustc-hash` transiently, this doesn't add
any more dependencies. As long as DOS attacks aren't a concern (which I
don't think they are?), this should be free performance.

In my (admittedly naive) testing, this really improved CPU usage in some
cases, which is pretty nice to get for free.
@mmstick
Copy link
Member

mmstick commented Oct 18, 2025

Are you able to use samply? Did you set debug = true on your release profile? Note that Debian packaging automatically strips debug symbols.

https://github.com/mstange/samply

@Cheong-Lau
Copy link
Contributor Author

Cheong-Lau commented Oct 18, 2025

Are you able to use samply?

I will check that out, thanks!

Did you set debug = true on your release profile?

Yeah, I was using the release-with-debug profile. cargo-flamegraph had a bunch of libc functions and didn't really have anything relevant to the Rust code I could see, so I'm not sure what's happening there. 😕
EDIT: maybe I wasn't giving perf the permissions it needed? hmm

@Cheong-Lau
Copy link
Contributor Author

@mmstick I got it working! Just needed to give perf the perms

Anyways, a quick benchmark opening a large folder (~2000 items)

Current main rustc-hash (this PR) rustc-hash + other random optimisations
~197 ms ~192 ms ~180 ms
current_main.json.gz rustc_hash.json.gz secret_sauce.json.gz

rustc-hash isn't really helping here, which is fair enough. It made the app feel snappier elsewhere, so I might benchmark something else later. But it means my other optimisations weren't for nothing! I'll keep working on them and open a new PR later.

Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

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

Regression testing passed:

Basic navigation

  • Middle-click opens directory in a new tab (not focused).
  • Open two scrollable tabs. Scroll one tab, then switch to the other tab; it should not have scrolled.
  • Hover over the top item in the folder, then scroll down until it's out of view (while still hovered). On scrolling back up (with the mouse in a different position), the item should not have the hover highlight.
    • Not a regression.
  • Right-click an item in the sidebar. No visual change should occur with the rest of the items.
    • Not a regression.
  • Remove an item from the sidebar, then re-pin it.

File operations

  • Right-click -> Create a new folder, then enter it.
  • Right-click in the empty folder -> Create a new file.
  • Files can be renamed.
  • Files can be opened with non-default apps & browsing store for new apps works.
  • Normal right-click shows Move to trash option.
  • Shift right-click, and right-click followed by Shift, both show Permanently delete option.
    • Shift + right-click broken (does nothing); right-click followed by shift works. Not a regression.

Advanced navigation & view settings

  • Image and video thumbnails display in local folders.
  • Gallery preview shows with Spacebar.
  • Details pane shows with Ctrl+Spacebar.
  • Zoom in/out and reset to default zoom work.
  • Ctrl+1 and Ctrl+2 switch between list and icon view.
  • Ctrl+H shows/hides hidden files.
  • Directories can be sorted at top or inline.
  • Settings -> Theme works.
  • Settings -> Type to Search affects behavior as designed.
  • Single-click to open setting takes effect.
  • Sorting options work.
  • Cutting, copying, and pasting files works.
  • F5 reloads current directory.
  • Left sidebar can be collapsed and expanded.

External filesystems

  • Add a network drive (e.g. SFTP) and navigate into it.
  • Plug in a USB drive; able to mount, browse, and eject.

Integrations

  • Desktop icons display as expected
  • Drag-and-drop into Firefox works

@jackpot51 jackpot51 merged commit 5863671 into pop-os:master Oct 28, 2025
10 checks passed
@Cheong-Lau Cheong-Lau deleted the rustc-hash branch October 29, 2025 02:41
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.

4 participants