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

perf!: reimplement and significantly speed up archive previewing #1220

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

sxyazi
Copy link
Owner

@sxyazi sxyazi commented Jun 26, 2024

This PR reimplements the archive preview to be streamed, meaning that only a small amount of necessary data needs to be read to display the preview immediately, rather than waiting for all the data to be returned and parsed as before.

Additionally, by replacing lsar with 7zip, the preview speed has been further improved.

The new implementation also provides two new features: icon display and file size display.

⚠️ Breaking changes

  • Used 7zip instead of lsar as the archive previewer dependency (Here's a new lsar.yazi plugin available for users who still want to stick with lsar)
  • ya.preview_archive() function has been removed

Benchmark

On my MacBook Air M2, testing with a 744.7M archive

New - 00.28s

new.mp4

Old - 16.33s

old.mp4

@sxyazi sxyazi merged commit 626053d into main Jun 26, 2024
6 checks passed
@sxyazi sxyazi deleted the pr-1628ab9c branch June 26, 2024 16:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant