Skip to content
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

refactor: rewrite chunked file #21

Merged
merged 1 commit into from
Apr 29, 2021

Conversation

driftluo
Copy link
Member

ref: tokio-rs/tokio#3664

AsyncRead does not have read_to_end semantics, which will result in io operations several times that of blocking read, which will cause chunked operations to become expensive

So, now it is rewritten as a sync operation of spawn_blocking. After testing, the performance is significantly improved

At the same time, rewrite the std read dir missed in the serve service into an async mode(it is also a product of spawn blocking)

@chrislearn chrislearn merged commit 75c7bfa into salvo-rs:master Apr 29, 2021
@driftluo driftluo deleted the rewrite-chunked-file branch April 29, 2021 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants