perf!: reimplement and significantly speed up archive previewing #1220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
with7zip
, the preview speed has been further improved.The new implementation also provides two new features: icon display and file size display.
7zip
instead oflsar
as the archive previewer dependency (Here's a new lsar.yazi plugin available for users who still want to stick withlsar
)ya.preview_archive()
function has been removedBenchmark
On my MacBook Air M2, testing with a 744.7M archive
New - 00.28s
new.mp4
Old - 16.33s
old.mp4