Comments (10)
You are right of course. I have downloaded the correct file now. It works as expected. Also: Not sure whether I was too tired to see it. But I just switched to decompress
(from multiDecompress
) and it works for both files. Yours and mine. ✅
The only question that remains is the speed. You were right regarding the Release mode. It only takes seconds (if not less) to decompress. In Debug mode to decompress a lz4 file of 31mb (decompressed ~126mb tar) takes ~150seconds. As long as the Release mode works I'm fine. ✅
I'll close the issue now. Thanks for your support.
from swcompression.
Hi @sarensw,
First, I would like to ask, if there is any specific reason, why you are using LZ4.multiDecompress
instead of LZ4.decompress
? The former is only useful if there are several "LZ4 frames" concatenated together. This seems to be quite rare in practice, so unless you know that is likely to be the case, you should use LZ4.decompress
, which in theory should be slightly faster in the case of one "LZ4 frame". In addition, you can then also remove the combining data code.
With regards to performance, let me first ask you, have you compiled SWCompression in the Release mode? If not, I suggest you to try it, the difference is usually quite substantial.
I have also tried this code on your test archive
SWCompressionSourceCode.tar.lz4
which I found in the test files repo. There the code just returns "corrupted". Am I loading the file wrong?
I am not sure why this is happening. Before writing this sentence I've double-checked and tested both LZ4.multiDecompress
and LZ4.decompress
with that file, and they work fine for me. I suspect that you may have got a "wrong" file. The test files in that repository are stored using Git LFS, so depending on how you have downloaded it, you may have got a git lfs reference file instead of the actual file.
from swcompression.
Hi @tsolomko , thanks for the quick answer.
The only reason I used LZ4.multiDecompress
is that with LZ4.decompress
all files fail with corrupt. Yours, and mine. I have just downloaded the test repo as a zip to have all the files available.
I'm honestly not sure weather I use Release mode or not. I just used the GitHub link in XCode to install the package. I'll check on later.
from swcompression.
The only reason I used
LZ4.multiDecompress
is that withLZ4.decompress
all files fail with corrupt. Yours, and mine. I have just downloaded the test repo as a zip to have all the files available.
When the test repo is downloaded as a zip, it contains git-lfs reference files instead of the actual files, so that's why they are "corrupted". As for why your files fail, if you can share an example with me, I can have a look.
from swcompression.
@tsolomko do you know any way to work with the release mode of the package while debugging an app? I have to use the Release mode of my app to try out things as it is really slow in Debug mode. Google didn't really help. Maybe you have a tip?
from swcompression.
This depends on how the package is installed. If you use Carthage, for instance, you can supply --configuration Release
option to the carthage update/bootstrap
invocation. For cocoapods, I think, you can change the xcode build settings of the SWCompression target in the generated xcode workspace.
from swcompression.
@tsolomko I'm using Swift Package Manager 😅
from swcompression.
@tsolomko I'm using Swift Package Manager 😅
I was hoping that you wouldn't say this 😄. I don't think there is any option that you can set in the package manifest to enable this, but if you're using SPM via its integration into Xcode maybe there are some target-specific build settings that you can change? (I have zero experience with SPM integration into Xcode, so I am just guessing.)
from swcompression.
😄 I thought so. I just started out with Swift last year and I have used SPM since then (XCode integration). I have googled already but couldn't find this. Thank you so much for your help anyways. Maybe I will try out Carthage then :).
from swcompression.
I'm using Carthage now and it works like a charm. Thanks again for your time and suggestion.
from swcompression.
Related Issues (20)
- Progress when decompression is needed HOT 1
- Memory issues when working with larger files HOT 8
- [CRASH] MsbBitReader.bit() HOT 4
- AR Format Support HOT 7
- Can Gzip unarchive return Member? HOT 1
- GzipArchive.unarchive wrongMagic for short data HOT 1
- Brotli Support? HOT 2
- Symlinks in tarballs are created with absolute paths HOT 3
- BZip2Error.wrongCRC when decompressing HOT 2
- Support File I/O for large archives and resource-constrained environments
- Error when decompressing a certain 7z file HOT 2
- Some zip files can't be extracted HOT 2
- LZ4 format not compatible? HOT 8
- Compiling for watchOS fails HOT 1
- Support splitting zips into multiple files
- Is there a way to extract a single file from a 7z compressed archive? HOT 4
- LZFSE Support
- Please update BitByteData dependency HOT 6
- Crash during GzipArchive.unarchive
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swcompression.