-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use perfect hash tables for file types and icons #173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really cool, but since it's such a substantial PR, I won't be able to review it fully as fast as the more trivial PRs.
Currently, it needs to be checked with clippy to pass CI, see https://github.com/eza-community/eza/actions/runs/5996553612/job/16263898274?pr=173
Sorry about the large change. It is mostly pulling various tables in the code into a few tables in the
These are compile time generated files. I have suppressed the clippy check |
I just realized I can use the macro version of phf instead of the code generation version. This would allow me to move the tables out of |
Then yes, that sounds very good. Icons changes seem very popular. |
Added constants for most of the commonly used icons.
|
Added constants for the rest of the icons used multiple times.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark 1: eza --blocksize -l --hyperlink --grid --git-repos -x --time-style relative ../ --git --header --icons
Time (mean ± σ): 1.840 s ± 0.082 s [User: 3.204 s, System: 2.419 s]
Range (min … max): 1.765 s … 2.033 s 10 runs
Benchmark 2: ./target/release/eza --blocksize -l --hyperlink --grid --git-repos -x --time-style relative ../ --git --header --icons
Time (mean ± σ): 1.787 s ± 0.031 s [User: 3.145 s, System: 2.413 s]
Range (min … max): 1.736 s … 1.828 s 10 runs
Summary
./target/release/eza --blocksize -l --hyperlink --grid --git-repos -x --time-style relative ../ --git --header --icons ran
1.03 ± 0.05 times faster than eza --blocksize -l --hyperlink --grid --git-repos -x --time-style relative ../ --git --header --icons
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready, seems to work as expected
5272a24
to
a133836
Compare
I had to interactive rebase to get commit summaries to conform to conventional commits:
But in the process, it seems github no longer sees your authorship, even with your set as a coauthor. Perhaps you wanna do an interactive rebase on your end and the force push it? Just change to commit summaries like I did and it should be fine. If not this should be ready to merge, just let me know. |
…reflect the purpose
a133836
to
e5cf097
Compare
I have rebased on main and updated the git log messages. |
Stripped down version of pull request ogham/exa#1229. I will add other new icons and add icon constants in other pull requests.
This should match the filetypes and icons on the current eza master branch with the following changes: