Replies: 11 comments
-
What are your thoughts on switching this crate to |
Beta Was this translation helpful? Give feedback.
-
Done. We can definitely improve the response time by using this syntax on some of the "info line" functions. |
Beta Was this translation helpful? Give feedback.
-
To make sure both onefetch and tokei have the same size vs speed optimizations, you might want to compile onefetch with the same release profile as tokei. [profile.release]
lto = "thin"
panic = "abort" |
Beta Was this translation helpful? Give feedback.
-
@o2sh When using tokei as a binary, which version are you running? tokei --version
# tokei 12.0.4 compiled with serialization support: json
time tokei ../linux
# roughly 26 seconds typically
time ./target/release/onefetch ../linux
# roughly 19 seconds typically Using tokei installed from Crates.io, onefetch compiled with |
Beta Was this translation helpful? Give feedback.
-
Bumped some dependencies that report performance improvements in the release notes |
Beta Was this translation helpful? Give feedback.
-
This is very strange, I'm also running the version 12.0.4 of tokei. Did you have smth running on your machine that may have interfered with the response time ? Do you get the same results every time ? I mean technically it's almost as if we were running tokei inside of onefetch so the RT(onefecth) should be RT(tokei) + Overhead |
Beta Was this translation helpful? Give feedback.
-
I did clone linux at |
Beta Was this translation helpful? Give feedback.
-
Alright, cloned at |
Beta Was this translation helpful? Give feedback.
-
In order to get a better picture of the Response time's distribution among function calls. I added a little telemetry (available on this branch) to detect the 'hot' spots 💥 where onefetch is struggling. Here are the results for the Linux repo:
...and the culprits are: get_creation_time > get_authors > get_commits |
Beta Was this translation helpful? Give feedback.
-
let repo: Repository; // declare repo
let first_commit = repo.rev().next().unwrap().peel_to_commit().unwrap(); Again, unfamiliar with |
Beta Was this translation helpful? Give feedback.
-
It's an idea worth exploring. Especially considering that |
Beta Was this translation helpful? Give feedback.
-
Onefetch's performance isn't so good to say the least. Even if we rely heavily on other tools for core functionalities (language statistics, license detection, git information), the post processing done by Onefetch adds a "significant" overhead - Moving forward, will require specific benchmarks to account for performance gain/losses - But a quick test on a relatively large repo Linux can give us a first idea:
o2sh:~/dev/linux (master) $ time onefetch --> 0m34,531s
o2sh:~/dev/linux (master) $ time tokei --> 0m11,897s
To achieve good performance some fundamental changes have to be made. Doing that will take a while because it makes it necessary to replace some core abstractions. The good news is that improving or even replacing those abstractions will have other benefits beside improved performance.
There are three primary paths for improving performance:
So aside from this overview, these changes will also be discussed independently, in dedicated issues.
Beta Was this translation helpful? Give feedback.
All reactions