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

Buffer writes to archive entries #4

Merged
merged 1 commit into from
Feb 3, 2025
Merged

Buffer writes to archive entries #4

merged 1 commit into from
Feb 3, 2025

Conversation

charliermarsh
Copy link
Member

Summary

For a large PyTorch wheel, this improves performance by about 20%.

Comment on lines -702 to +711
let to = SeekFrom::Current(d.limit() as i64);
let size = f.seek(to).await?;
f.set_len(size).await?;
let pad_len = d.limit() as i64;
writer.flush().await?;
let f = writer.get_mut();
let new_size = f.seek(SeekFrom::Current(pad_len)).await?;
f.set_len(new_size).await?;
Copy link
Member

Choose a reason for hiding this comment

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

Is there documentation on when we need this padding and how the seek/set_len trick works?

charliermarsh added a commit to astral-sh/uv that referenced this pull request Feb 3, 2025
## Summary

I shipped one security fix here along with several significant
performance improvements for large TAR files:

- astral-sh/tokio-tar#2
- astral-sh/tokio-tar#4
- astral-sh/tokio-tar#5

I also PR'd the security fix to `edera-dev`
(edera-dev/tokio-tar#4).
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