GithubHelp home page GithubHelp logo

Comments (5)

dillof avatar dillof commented on July 17, 2024

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.

fightingLKH avatar fightingLKH commented on July 17, 2024

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.

dillof avatar dillof commented on July 17, 2024

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.

fightingLKH avatar fightingLKH commented on July 17, 2024

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.

dillof avatar dillof commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.