Skip to content

Remove async/await #309

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

Merged
merged 1 commit into from
Nov 4, 2020
Merged

Remove async/await #309

merged 1 commit into from
Nov 4, 2020

Conversation

o2sh
Copy link
Owner

@o2sh o2sh commented Nov 3, 2020

With async/await on the linux repo:

#Response times for async calls
o2sh ~/dev/onefetch (telemetry) > onefetch ../linux/
get_number_of_tags_branches --> 40.105318ms
get_git_version_and_username --> 39.971554ms
get_packed_size --> 89.731579ms
get_version --> 189.732919ms
get_pending_changes --> 199.959989ms
get_git_history --> 18.836888247s

get_git_history is overwhelmingly slower than the other functions;even with async/await the execution is still very synchronous-like.

time onefetch ../linux

real	0m22,442s
user	0m48,883s
sys	0m6,863s

Without async/await on the linux repo:

time onefetch ../linux

real	0m15,631s
user	0m22,745s
sys	0m4,017s

It may have been a false good idea to add tokio runtime - with its huge added complexity - to onefetch. Especially considering the use case - only one very slow function get_git_history -. Without async/await, onefetch appears to compile and run faster and use less cpu resources (cf. user time).

Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@o2sh o2sh merged commit bdd3867 into master Nov 4, 2020
@o2sh
Copy link
Owner Author

o2sh commented Nov 4, 2020

Thanks @spenserblack

@o2sh o2sh deleted the remove_tokio branch November 4, 2020 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants