Repository navigation
Replies: 11 comments
|
What are your thoughts on switching this crate to |
Done. We can definitely improve the response time by using this syntax on some of the "info line" functions. |
|
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" |
|
@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 typicallyUsing tokei installed from Crates.io, onefetch compiled with |
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 |
|
I did clone linux at |
|
Alright, cloned at |
|
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 |
|
let repo: Repository; // declare repo
let first_commit = repo.rev().next().unwrap().peel_to_commit().unwrap();Again, unfamiliar with |
It's an idea worth exploring. Especially considering that |
Uh oh!
There was an error while loading. Please reload this page.
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,531so2sh:~/dev/linux (master) $ time tokei --> 0m11,897sTo 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.
All reactions