GithubHelp home page GithubHelp logo

Comments (2)

Cyan4973 avatar Cyan4973 commented on April 28, 2024 1

Is the compressionLevel in ZSTD_sequenceProducer_F function always the same value as ZSTD_c_compressionLevel set by ZSTD_CCtx_setParameter?

Yes.
It's mostly informational btw. The sequence producer is free to do whatever it wants with this information, including ignoring it.

My assumption is that ZSTD_c_compressionLevel somehow influences the 'compress sequences' step.

It's true. It's more a side-effect though.

There are multiple cpu / compression trade-offs in the pipeline. They are roughly influenced by the compression level.
Now, because there are so many of them, I can't tell for sure which ones have impacted your observations.

As a simple example, the "minimum compression" threshold, which is both a guess and a verification deciding to not compress literals if it doesn't produce at least a certain amount of savings compared to "just store uncompressed", this threshold changes depending on compression level.
And there are others too. For example, there is a block splitter which is triggered at some point. This advanced strategy decides to cut a block into 2 or more parts if it can produce more adjusted statistics for each part, resulting in better compression ratio. This is expensive, but compared to the rest of the pipeline, it's negligible at high compression levels. This might be the one you observed in your tests.

So there are multiple heuristics decisions across the pipeline, and their behavior is influenced by the compression level. Sometimes, there are some advanced flags that can take over from the heuristics to unconditionally enable or disable the feature, sometimes not. This is mostly because these features were added later on, one by one, and there was a lack of common framework, resulting in each feature implementing its own slightly different way to be controlled and triggered. A refactoring could be needed at some point, but until then, the general idea is that "higher compression level" means "more cpu available for compression ratio", but the exact technical translation is more complex to detail (and changes with versions).

from zstd.

b3ng1998 avatar b3ng1998 commented on April 28, 2024

Thanks for the explanation.

from zstd.

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.