refactor: Replace Gzip compression with LZ4 in file handling#1306
Draft
OmarBrbutovic wants to merge 1 commit intoedgehog-device-manager:mainfrom
Draft
refactor: Replace Gzip compression with LZ4 in file handling#1306OmarBrbutovic wants to merge 1 commit intoedgehog-device-manager:mainfrom
OmarBrbutovic wants to merge 1 commit intoedgehog-device-manager:mainfrom
Conversation
On MCU we have stricter resource requirements and having deflate to work is often difficult and inefficient. Signed-off-by: Omar <omar.brbutovic@secomind.com>
4a6c827 to
4069e40
Compare
osmanhadzic
reviewed
Mar 26, 2026
| // Creates a tar.gz archive from multiple files. | ||
| // Creates an LZ4 compressed tar archive from multiple files. | ||
| // Returns a Blob of the compressed archive. | ||
| const createTarGzArchive = async (files: File[]): Promise<Blob> => { |
Contributor
There was a problem hiding this comment.
Suggested change
| const createTarGzArchive = async (files: File[]): Promise<Blob> => { | |
| const createTarLz4Archive = async (files: File[]): Promise<Blob> => { |
|
|
||
| // Run compression on a later tick so callers can await it asynchronously. | ||
| const lz4Data = await new Promise<Uint8Array>((resolve) => { | ||
| setTimeout(() => resolve(compress(tarData)), 0); |
Contributor
There was a problem hiding this comment.
Remove the setTimeout wrapper (it doesn’t make compression truly async).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
On MCU we have stricter resource requirements and having deflate to work is often difficult and inefficient.
Additional documentation e.g. usage docs, diagrams, reviewer notes, etc.:
Thanks for sending a pull request! If this is your first time, here are some tips for you:
When fixing existing issues, use github's syntax to link your pull request to it
We also have a syntax to signal dependencies to other open pull requests
In case of stacked PRs, you may add the PR number in the last commit's title instead: