Compress-Zstd

 view release on metacpan or  search on metacpan

ext/zstd/lib/compress/zstd_ldm.c  view on Meta::CPAN

         * TODO: * Test the chunk size.
         *       * Try invalidation after the sequence generation and test the
         *         the offset against maxDist directly.
         */
        ZSTD_window_enforceMaxDist(&ldmState->window, chunkEnd, maxDist, NULL, NULL);
        /* 3. Generate the sequences for the chunk, and get newLeftoverSize. */
        newLeftoverSize = ZSTD_ldm_generateSequences_internal(
            ldmState, sequences, params, chunkStart, chunkSize);
        if (ZSTD_isError(newLeftoverSize))
            return newLeftoverSize;
        /* 4. We add the leftover literals from previous iterations to the first
         *    newly generated sequence, or add the `newLeftoverSize` if none are
         *    generated.
         */
        /* Prepend the leftover literals from the last call */
        if (prevSize < sequences->size) {
            sequences->seq[prevSize].litLength += (U32)leftoverSize;
            leftoverSize = newLeftoverSize;
        } else {
            assert(newLeftoverSize == chunkSize);
            leftoverSize += chunkSize;

ext/zstd/tests/paramgrill.c  view on Meta::CPAN

            }
        }
        winnerInfo = bestFeasible1;
    }

    return winnerInfo;
}

/* Optimizes for a fixed strategy */

/* flexible parameters: iterations of failed climbing (or if we do non-random, maybe this is when everything is close to visited)
   weight more on visit for bad results, less on good results/more on later results / ones with more failures.
   allocate memoTable here.
 */
static winnerInfo_t
optimizeFixedStrategy(const buffers_t buf, const contexts_t ctx,
                      const constraint_t target, paramValues_t paramTarget,
                      const ZSTD_strategy strat,
                      memoTable_t* memoTableArray, const int tries)
{
    int i = 0;

ext/zstd/tests/paramgrill.c  view on Meta::CPAN

            }
        }

        DEBUGOUTPUT("Real Opt\n");
        /* start 'real' optimization */
        {   int bestStrategy = (int)winner.params.vals[strt_ind];
            if (paramTarget.vals[strt_ind] == PARAM_UNSET) {
                int st = bestStrategy;
                int tries = g_maxTries;

                /* one iterations of hill climbing with the level-defined parameters. */
                {   winnerInfo_t const w1 = climbOnce(target, allMT, buf, ctx, winner.params);
                    if (compareResultLT(winner.result, w1.result, target, buf.srcSize)) {
                        winner = w1;
                    }
                    CHECKTIMEGT(ret, 0, _displayCleanUp);
                }

                while(st && tries > 0) {
                    winnerInfo_t wc;
                    DEBUGOUTPUT("StrategySwitch: %s\n", g_stratName[st]);

ext/zstd/tests/zstreamtest.c  view on Meta::CPAN

                case 'q':
                    argument++;
                    g_displayLevel--;
                    break;

                case 'p': /* pause at the end */
                    argument++;
                    mainPause = 1;
                    break;

                case 'i':   /* limit tests by nb of iterations (default) */
                    argument++;
                    nbTests=0; g_clockTime=0;
                    while ((*argument>='0') && (*argument<='9')) {
                        nbTests *= 10;
                        nbTests += *argument - '0';
                        argument++;
                    }
                    break;

                case 'T':   /* limit tests by time */



( run in 0.606 second using v1.01-cache-2.11-cpan-96521ef73a4 )