Rizin
unix-like reverse engineering framework and cli tools
|
#include "platform.h"
#include "util.h"
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <time.h>
#include "lz4.h"
#include "lz4hc.h"
#include "lz4frame.h"
#include "xxhash.h"
Go to the source code of this file.
Classes | |
struct | chunkParameters |
Macros | |
#define | LZ4_DISABLE_DEPRECATE_WARNINGS /* LZ4_decompress_fast */ |
#define | PROGRAM_DESCRIPTION "LZ4 speed analyzer" |
#define | AUTHOR "Yann Collet" |
#define | WELCOME_MESSAGE "*** %s v%s %i-bits, by %s ***\n", PROGRAM_DESCRIPTION, LZ4_VERSION_STRING, (int)(sizeof(void*)*8), AUTHOR |
#define | NBLOOPS 6 |
#define | TIMELOOP (CLOCKS_PER_SEC * 25 / 10) |
#define | KB *(1 <<10) |
#define | MB *(1 <<20) |
#define | GB *(1U<<30) |
#define | KNUTH 2654435761U |
#define | MAX_MEM (1920 MB) |
#define | DEFAULT_CHUNKSIZE (4 MB) |
#define | ALL_COMPRESSORS 0 |
#define | ALL_DECOMPRESSORS 0 |
#define | DISPLAY(...) fprintf(stderr, __VA_ARGS__) |
#define | PROGRESS(...) g_noPrompt ? 0 : DISPLAY(__VA_ARGS__) |
#define | NB_COMPRESSION_ALGORITHMS 100 |
#define | NB_DECOMPRESSION_ALGORITHMS 100 |
Variables | |
static int | g_chunkSize = DEFAULT_CHUNKSIZE |
static int | g_nbIterations = NBLOOPS |
static int | g_pause = 0 |
static int | g_compressionTest = 1 |
static int | g_compressionAlgo = ALL_COMPRESSORS |
static int | g_decompressionTest = 1 |
static int | g_decompressionAlgo = ALL_DECOMPRESSORS |
static int | g_noPrompt = 0 |
static LZ4_stream_t | LZ4_stream |
LZ4_streamHC_t | LZ4_streamHC |
static LZ4F_decompressionContext_t | g_dCtx |
#define ALL_COMPRESSORS 0 |
Definition at line 71 of file fullbench.c.
#define ALL_DECOMPRESSORS 0 |
Definition at line 72 of file fullbench.c.
#define AUTHOR "Yann Collet" |
Definition at line 57 of file fullbench.c.
#define DEFAULT_CHUNKSIZE (4 MB) |
Definition at line 69 of file fullbench.c.
#define DISPLAY | ( | ... | ) | fprintf(stderr, __VA_ARGS__) |
Definition at line 91 of file fullbench.c.
#define GB *(1U<<30) |
Definition at line 65 of file fullbench.c.
#define KB *(1 <<10) |
Definition at line 63 of file fullbench.c.
#define KNUTH 2654435761U |
Definition at line 67 of file fullbench.c.
#define LZ4_DISABLE_DEPRECATE_WARNINGS /* LZ4_decompress_fast */ |
Definition at line 45 of file fullbench.c.
#define MAX_MEM (1920 MB) |
Definition at line 68 of file fullbench.c.
#define MB *(1 <<20) |
Definition at line 64 of file fullbench.c.
#define NB_COMPRESSION_ALGORITHMS 100 |
Definition at line 431 of file fullbench.c.
#define NB_DECOMPRESSION_ALGORITHMS 100 |
Definition at line 432 of file fullbench.c.
#define NBLOOPS 6 |
Definition at line 60 of file fullbench.c.
#define PROGRAM_DESCRIPTION "LZ4 speed analyzer" |
Definition at line 56 of file fullbench.c.
#define PROGRESS | ( | ... | ) | g_noPrompt ? 0 : DISPLAY(__VA_ARGS__) |
Definition at line 92 of file fullbench.c.
#define TIMELOOP (CLOCKS_PER_SEC * 25 / 10) |
Definition at line 61 of file fullbench.c.
#define WELCOME_MESSAGE "*** %s v%s %i-bits, by %s ***\n", PROGRAM_DESCRIPTION, LZ4_VERSION_STRING, (int)(sizeof(void*)*8), AUTHOR |
Definition at line 58 of file fullbench.c.
Definition at line 134 of file fullbench.c.
References free(), malloc(), MAX_MEM, MB, NULL, and step().
Referenced by fullSpeedBench().
Definition at line 128 of file fullbench.c.
Referenced by fullSpeedBench().
|
static |
Definition at line 107 of file fullbench.c.
References DISPLAY, and g_chunkSize.
Referenced by main().
|
static |
Definition at line 113 of file fullbench.c.
References DISPLAY, and g_nbIterations.
Referenced by main().
|
static |
Definition at line 433 of file fullbench.c.
References ALL_COMPRESSORS, ALL_DECOMPRESSORS, assert(), BMK_findMaxMem(), BMK_GetClockSpan(), chunkParameters::compressedBuffer, compressedSize, chunkParameters::compressedSize, test-lz4-speed::default, DISPLAY, test-lz4-list::exit, benchmark::FILE, free(), g_chunkSize, g_compressionAlgo, g_compressionTest, g_dCtx, g_decompressionAlgo, g_decompressionTest, g_nbIterations, g_pause, i, chunkParameters::id, in, int, local_LZ4_compress_default_large(), local_LZ4_compress_default_small(), local_LZ4_compress_destSize(), local_LZ4_compress_fast0(), local_LZ4_compress_fast1(), local_LZ4_compress_fast17(), local_LZ4_compress_fast2(), local_LZ4_compress_fast_continue0(), local_LZ4_compress_fast_extState0(), local_LZ4_compress_forceDict(), local_LZ4_compress_HC(), local_LZ4_compress_HC_continue(), local_LZ4_compress_HC_extStateHC(), local_LZ4_createStream(), local_LZ4_decompress_fast(), local_LZ4_decompress_fast_usingDict_prefix(), local_LZ4_decompress_fast_usingExtDict(), local_LZ4_decompress_safe_forceExtDict(), local_LZ4_decompress_safe_partial(), local_LZ4_decompress_safe_usingDict(), local_LZ4_decompress_safe_withPrefix64k(), local_LZ4_resetDictT(), local_LZ4_resetStreamHC(), local_LZ4_saveDict(), local_LZ4_saveDictHC(), local_LZ4F_compressFrame(), local_LZ4F_decompress(), local_LZ4F_decompress_followHint(), local_LZ4F_decompress_noHint(), LZ4_compress_default(), LZ4_compressBound(), LZ4_decompress_safe(), LZ4_loadDict(), LZ4_loadDictHC(), LZ4_stream, LZ4_streamHC, LZ4F_compressFrame(), LZ4F_createDecompressionContext(), LZ4F_freeDecompressionContext(), LZ4F_isError(), LZ4F_VERSION, malloc(), NB_COMPRESSION_ALGORITHMS, NB_DECOMPRESSION_ALGORITHMS, NULL, chunkParameters::origBuffer, chunkParameters::origSize, out, printf(), PROGRESS, TIMELOOP, U32, UTIL_getFileSize(), and XXH32().
Referenced by main().
Definition at line 188 of file fullbench.c.
References in, LZ4_compress_default(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 193 of file fullbench.c.
References in, LZ4_compress_default(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 198 of file fullbench.c.
References in, LZ4_compress_destSize(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 203 of file fullbench.c.
References in, LZ4_compress_fast(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 208 of file fullbench.c.
References in, LZ4_compress_fast(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 218 of file fullbench.c.
References in, LZ4_compress_fast(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 213 of file fullbench.c.
References in, LZ4_compress_fast(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 228 of file fullbench.c.
References in, LZ4_compress_fast_continue(), LZ4_compressBound(), LZ4_stream, and out.
Referenced by fullSpeedBench().
Definition at line 223 of file fullbench.c.
References in, LZ4_compress_fast_extState(), LZ4_compressBound(), LZ4_stream, and out.
Referenced by fullSpeedBench().
Definition at line 245 of file fullbench.c.
References in, LZ4_compress_forceExtDict(), LZ4_stream, and out.
Referenced by fullSpeedBench().
Definition at line 265 of file fullbench.c.
References in, LZ4_compress_HC(), LZ4_compressBound(), and out.
Referenced by fullSpeedBench().
Definition at line 275 of file fullbench.c.
References in, LZ4_compress_HC_continue(), LZ4_compressBound(), LZ4_streamHC, and out.
Referenced by fullSpeedBench().
Definition at line 270 of file fullbench.c.
References in, LZ4_compress_HC_extStateHC(), LZ4_compressBound(), LZ4_streamHC, and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 176 of file fullbench.c.
References assert(), LZ4_initStream(), LZ4_stream, NULL, and r.
Referenced by fullSpeedBench().
|
static |
Definition at line 282 of file fullbench.c.
References in, LZ4_decompress_fast(), and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 289 of file fullbench.c.
References in, LZ4_decompress_fast_usingDict(), and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 296 of file fullbench.c.
References in, LZ4_decompress_fast_usingDict(), and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 326 of file fullbench.c.
References in, LZ4_decompress_safe_forceExtDict(), and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 334 of file fullbench.c.
References in, LZ4_decompress_safe_partial(), and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 309 of file fullbench.c.
References in, LZ4_decompress_safe_usingDict(), and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 303 of file fullbench.c.
References in, LZ4_decompress_safe_withPrefix64k(), and out.
Referenced by fullSpeedBench().
|
static |
Definition at line 170 of file fullbench.c.
References assert(), LZ4_initStream(), LZ4_stream, NULL, and r.
Referenced by fullSpeedBench().
|
static |
Definition at line 254 of file fullbench.c.
References LZ4_initStreamHC(), and LZ4_streamHC.
Referenced by fullSpeedBench().
Definition at line 182 of file fullbench.c.
References in, LZ4_saveDict(), LZ4_stream, and out.
Referenced by fullSpeedBench().
Definition at line 259 of file fullbench.c.
References in, LZ4_saveDictHC(), LZ4_streamHC, and out.
Referenced by fullSpeedBench().
Definition at line 343 of file fullbench.c.
References assert(), in, LZ4F_compressFrame(), LZ4F_compressFrameBound(), NULL, and out.
Referenced by fullSpeedBench().
Definition at line 351 of file fullbench.c.
References assert(), DISPLAY, test-lz4-list::exit, g_dCtx, in, LZ4F_decompress(), NULL, out, and srcSize.
Referenced by fullSpeedBench().
|
static |
Definition at line 364 of file fullbench.c.
References assert(), DISPLAY, dst, test-lz4-list::exit, g_dCtx, LZ4F_decompress(), LZ4F_isError(), NULL, src, and srcSize.
Referenced by fullSpeedBench().
|
static |
Definition at line 398 of file fullbench.c.
References assert(), DISPLAY, dst, test-lz4-list::exit, g_dCtx, KB, LZ4F_decompress(), LZ4F_isError(), NULL, src, and srcSize.
Referenced by fullSpeedBench().
Definition at line 162 of file fullbench.c.
int LZ4_compress_forceExtDict | ( | LZ4_stream_t * | LZ4_stream, |
const char * | source, | ||
char * | dest, | ||
int | inputSize | ||
) |
Definition at line 1641 of file lz4.c.
References byU32, LZ4_stream_t_internal::currentOffset, dest, LZ4_stream_t_internal::dictionary, LZ4_stream_t_internal::dictSize, dictSmall, LZ4_stream_u::internal_donotuse, KB, LZ4_compress_generic(), LZ4_renormDictT(), noDictIssue, notLimited, NULL, source, srcSize, and usingExtDict.
Referenced by local_LZ4_compress_forceDict().
int LZ4_decompress_safe_forceExtDict | ( | const char * | in, |
char * | out, | ||
int | inSize, | ||
int | outSize, | ||
const void * | dict, | ||
size_t | dictSize | ||
) |
Definition at line 2223 of file lz4.c.
References compressedSize, decode_full_block, dest, endOnInputSize, LZ4_decompress_generic(), maxOutputSize, source, and usingExtDict.
Referenced by local_LZ4_decompress_safe_forceExtDict(), LZ4_decompress_safe_continue(), and LZ4_decompress_safe_usingDict().
void LZ4_free | ( | void * | p | ) |
Definition at line 163 of file fullbench.c.
void* LZ4_malloc | ( | size_t | s | ) |
Definition at line 767 of file fullbench.c.
References argv, B, badusage(), BMK_setBlocksize(), BMK_setNbIterations(), BMK_setPause(), test-lz4-speed::default, DISPLAY, fullSpeedBench(), g_compressionAlgo, g_compressionTest, g_decompressionAlgo, g_decompressionTest, g_noPrompt, i, S, usage(), usage_advanced(), and WELCOME_MESSAGE.
Definition at line 739 of file fullbench.c.
References DISPLAY.
Referenced by badusage(), and main().
|
static |
Definition at line 750 of file fullbench.c.
References DISPLAY, NB_COMPRESSION_ALGORITHMS, NB_DECOMPRESSION_ALGORITHMS, and NBLOOPS.
Referenced by main().
|
static |
Definition at line 98 of file fullbench.c.
Referenced by BMK_setBlocksize(), and fullSpeedBench().
|
static |
Definition at line 102 of file fullbench.c.
Referenced by fullSpeedBench(), and main().
|
static |
Definition at line 101 of file fullbench.c.
Referenced by fullSpeedBench(), and main().
|
static |
Definition at line 349 of file fullbench.c.
Referenced by fullSpeedBench(), local_LZ4F_decompress(), local_LZ4F_decompress_followHint(), and local_LZ4F_decompress_noHint().
|
static |
Definition at line 104 of file fullbench.c.
Referenced by fullSpeedBench(), and main().
|
static |
Definition at line 103 of file fullbench.c.
Referenced by fullSpeedBench(), and main().
Definition at line 99 of file fullbench.c.
Referenced by BMK_setNbIterations(), and fullSpeedBench().
|
static |
Definition at line 105 of file fullbench.c.
Referenced by main().
|
static |
Definition at line 100 of file fullbench.c.
Referenced by BMK_setPause(), and fullSpeedBench().
|
static |
Definition at line 169 of file fullbench.c.
Referenced by fullSpeedBench(), FUZ_test(), local_LZ4_compress_fast_continue0(), local_LZ4_compress_fast_extState0(), local_LZ4_compress_forceDict(), local_LZ4_createStream(), local_LZ4_resetDictT(), local_LZ4_saveDict(), LZ4_compress_continue(), LZ4_compress_fast_continue(), LZ4_compress_limitedOutput_continue(), LZ4_freeStream(), LZ4_freeStreamDecode(), and LZ4_resetStream().
LZ4_streamHC_t LZ4_streamHC |
Definition at line 253 of file fullbench.c.
Referenced by fullSpeedBench(), FUZ_test(), local_LZ4_compress_HC_continue(), local_LZ4_compress_HC_extStateHC(), local_LZ4_resetStreamHC(), and local_LZ4_saveDictHC().