Comments (5)
By how much does the CPU usage increase? libzip is reading and writing data, and calculating CRCs, so some CPU usage is expected.
Also, could you please provide the source code for relevant portions of the program you're using.
from libzip.
Here is my core code. In the zip_set_file_compression() function, the parameter ZIP_CM_STORE was passed in, which only performs packaging operations without compression. If the file is around 40MB, The CPU load will increase by 20%. If the file size is 300M, The CPU load will increase by 50%. May I ask if there are any solutions or improvement codes? Please provide them. Thank you!
zip_source* srcfile=zip_source_file(zip,filePath.c_str(),0,-1);
index=zip_file_add(zip, (currentDir+ entry->d_name).c_str(), srcfile, ZIP_FL_ENC_GUESS);
zip_set_file_compression(zip,index,ZIP_CM_STORE,1)
from libzip.
CPU is there to be used, so the percentage increase alone doesn't say much. For how long does it stay at that usage level? Can you try the same operation with some other archival program, like the zip command line tool, and compare usage levels and times?
from libzip.
The increase in CPU load will affect the normal operation of other modules, which is not allowed. We hope that when using libzip for packaging, there will be minimal changes in CPU load. Can we handle this through multi-threaded technology? However, I did not see any interfaces for multi-threaded operations on the official website of libzip.
from libzip.
No, libzip does not support multi-threaded access to an archive.
Without detailed knowledge of your setup and requirements, I'm afraid I can't help you. If you profile libzip and find a section that is inefficient, we'll gladly look into it.
from libzip.
Related Issues (20)
- Does libzip support "Central Directory Encryption"? HOT 6
- Add a different error code for truncated ZIPs HOT 3
- zip_close failed cause filesystem handle to leak. HOT 3
- How to save or socket an archive from memory? HOT 3
- ld: library 'zip' not found HOT 2
- libzip::zip doesn't exist HOT 2
- Make CMake options consistent HOT 5
- No rule to make target 'zlib.h', needed by 'lib/libzip.dll' HOT 7
- ZIP_CM_SHRINK and ZIP_CM_IMPLODE give unsupported compression method error HOT 1
- Error when use with CPM (cmake package manager) HOT 1
- ZIP_ER_INCONS error (Zip archive inconsistent) on an apparently valid ZIP archive HOT 2
- error while loading shared libraries from /usr/local/lib, dir not in path under Linux Mint HOT 1
- 4 GB limit? HOT 1
- Functionality for creation of split-volume zip files based on individual byte ranges of complete file HOT 3
- Creating ZIP archives is not properly handling wchar_t on Windows 11/x64.
- Crash with illegal instruction under Windows 11 x64 ARM virtualization HOT 2
- Fix documentation of `zip_source_win32handle` HOT 1
- Enhance documentation of `zip_source_zip_file` and `zip_source_zip` HOT 2
- writing zip file fails HOT 2
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 libzip.