This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
Conversation
|
Optimization is great! But neofetch isn't something that people run a lot, so I think compatibility is more important than performance here |
This branch has not been deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Description
Speed up the performance of
get_packagesby redesign the flow.Currently,
get_packageruns unacceptably slow on WSL. The reason is its call totype. Each failtypecall can consume 0.1s on a WSL machine. There are too many package managers to check and in total the checks consume too much time.So, in the new flow, all the package managers are checked at once by list all executables in $PATH directories and then grep all the files. Thus we get a hit file list of possible package managers. Then each
hascall can just runtypefor package managers who show in the hit list.On WSL, the upgraded version is much faster than the original one.
Before modification:
After modification:
TODO
This branch is only tested on a WSL machine. The influence on other platforms is unknown yet.