refactor: use Vec<OsString> path-component keys in coloring map#341
Closed
refactor: use Vec<OsString> path-component keys in coloring map#341
Vec<OsString> path-component keys in coloring map#341Conversation
Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…ify rendering Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…, update docs Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
… remove redundant attributes Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…structure TreeHorizontalSlice Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…ucturing Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…ice/aligned_plain_slice Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…loredTreeHorizontalSlice Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…re coloring, move color logic to App::run Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…erse-kinds workspace, fix tests Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…_COLORS Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
… lint Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…ollision Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
… ansi_prefixes to ls_colors, update doc comment, make lscolors optional under color feature Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
…endency Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix issue raised in PR 339 discussion
refactor: use Mar 7, 2026
Vec<OsString> path-component keys in coloring map
Performance Regression Reportscommit: 0a14ab2 --quantity=block-size --max-depth=10 --min-ratio=0.01 --progress --no-sort
LogsJSON{
"results": [
{
"command": "pdu",
"mean": 0.11565717823142858,
"stddev": 0.03182600536287003,
"median": 0.10483375516000001,
"user": 0.10325187999999998,
"system": 0.28960444714285716,
"min": 0.10444145916,
"max": 0.20611908016000002,
"times": [
0.10483360616000001,
0.10536676816,
0.10498553216,
0.10463197716,
0.20560741016000003,
0.20611908016000002,
0.10481444016000001,
0.10444145916,
0.10494726716000001,
0.10468409116,
0.10479486016,
0.10473025816,
0.10454814716000001,
0.10471061216000001,
0.10484728916000001,
0.10493740916000001,
0.10461414016000001,
0.10457954516000001,
0.20589323116000002,
0.10526272016,
0.10522843616000001,
0.10483390416,
0.10483886316,
0.10494731716000001,
0.10471859716000001,
0.10500092816,
0.10466757116,
0.10481552916
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
{
"command": "pdu-0.20.0",
"mean": 0.10467846512428576,
"stddev": 0.0002601303160709016,
"median": 0.10471571666000001,
"user": 0.1048030942857143,
"system": 0.28734730428571414,
"min": 0.10414432716000001,
"max": 0.10528667516000001,
"times": [
0.10480003016,
0.10481312516,
0.10432635916,
0.10476139716,
0.10414432716000001,
0.10500939416,
0.10429905816,
0.10484294116000001,
0.10472180316,
0.10477673616000001,
0.10417065616,
0.10470080316000001,
0.10480409816000001,
0.10457502716,
0.10485791916000001,
0.10457604916,
0.10470963016000001,
0.10455243416,
0.10453949016000001,
0.10513959916,
0.10457870416000001,
0.10528667516000001,
0.10480203416,
0.10445526216,
0.10474218116,
0.10469200616,
0.10483232116,
0.10448696116
],
"exit_codes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
}
]
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coloring's internal map usedPathBufas keys, causingPathBuf::join()to copy all ancestor bytes at every recursion level inbuild_coloring_map— O(total_path_bytes) work per internal node.Changes
src/visualizer/coloring.rs—map: HashMap<PathBuf, Color>→HashMap<Vec<OsString>, Color>;node_colornow accepts&[OsString]instead of&Pathsrc/app/sub.rs—build_coloring_maprefactored to use a mutable push/pop stack (&mut Vec<OsString>); cloning happens only at leaf insertions, not at every internal node;PathBufis still assembled per-leaf forfile_color()OS stat callssrc/visualizer/methods.rs— lookup path constructed asVec<OsString>instead ofPathBuf::collect()tests/usual_cli.rs— manual map entries updated toVec<OsString>keysBefore (clone full path at every node):
After (push/pop stack, clone only at leaves):
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/KSXGitHub/parallel-disk-usage/pulls/339/comments/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(http block)If you need me to access, download, or install something from one of these locations, you can either:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.