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

Optimize implementation of image-rs/stream #264

Merged
merged 4 commits into from
Jul 11, 2023

Conversation

jiangliu
Copy link
Member

@jiangliu jiangliu commented Jul 4, 2023

Optimize implementation of image-rs/stream:

  1. unify digest algorithm prefixes
  2. avoid unnecessary memory copy
  3. simplify function stream_processing()
  4. get rid of flume crate to reduce dependency

Matching hasher algorithm with ":", such as "sha256:" instead of
"sha256".

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
Simplify implementation of stream_processing().

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
There's an explicit memory allocation and copy operation behind
`buffer[..n].to_vec()`, so optimzie code to avoid unnecessary memory
copy operation.

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
There's only one sender and one receiver, so replace flume with
std::sync::mpsc to reduce dependency by 7.

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
Copy link
Member

@arronwy arronwy left a comment

Choose a reason for hiding this comment

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

Thanks @jiangliu LGTM!

@arronwy arronwy merged commit 8f42f9a into confidential-containers:main Jul 11, 2023
7 of 8 checks passed
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