CMSIS2000  0.0.7
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bench.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "lz4.h"
#include "lz4hc.h"
#include <stdint.h>
Include dependency graph for bench.c:

Go to the source code of this file.

Data Structures

struct  chunkParameters
struct  compressionParameters

Macros

#define _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_WARNINGS
#define _LARGEFILE64_SOURCE
#define _rotl(x, r)   ((x << r) | (x >> (32 - r)))
#define BYTE   uint8_t
#define COMPRESSOR0   LZ4_compress
#define COMPRESSOR1   LZ4_compressHC
#define DEFAULT_CHUNKSIZE   (8<<20)
#define DEFAULTCOMPRESSOR   LZ4_compress
#define DISPLAY(...)   fprintf(stderr, __VA_ARGS__)
#define KNUTH   2654435761U
#define MAX_MEM   (1984<<20)
#define NBLOOPS   3
#define S32   int32_t
#define TIMELOOP   2000
#define U16   uint16_t
#define U32   uint32_t
#define U64   uint64_t

Functions

int BMK_benchFile (char **fileNamesTable, int nbFiles, int cLevel)
static U32 BMK_checksum_MMH3A (char *buff, U32 length)
static size_t BMK_findMaxMem (U64 requiredMem)
static U64 BMK_GetFileSize (char *infilename)
static int BMK_GetMilliSpan (int nTimeStart)
static int BMK_GetMilliStart ()
void BMK_SetBlocksize (int bsize)
void BMK_SetNbIterations (int nbLoops)
void BMK_SetPause ()

Variables

static int BMK_pause = 0
static int chunkSize = DEFAULT_CHUNKSIZE
static int nbIterations = NBLOOPS

Macro Definition Documentation

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 30 of file bench.c.

#define _CRT_SECURE_NO_WARNINGS

Definition at line 29 of file bench.c.

#define _LARGEFILE64_SOURCE

Definition at line 37 of file bench.c.

#define _rotl (   x,
 
)    ((x << r) | (x >> (32 - r)))

Definition at line 48 of file bench.c.

Referenced by BMK_checksum_MMH3A().

#define BYTE   uint8_t

Definition at line 86 of file bench.c.

Referenced by LZ4_compress64kCtx(), LZ4_compressCtx(), LZ4_compressHCCtx(), and LZ4_encodeSequence().

#define COMPRESSOR0   LZ4_compress

Definition at line 68 of file bench.c.

Referenced by BMK_benchFile().

#define COMPRESSOR1   LZ4_compressHC

Definition at line 70 of file bench.c.

Referenced by BMK_benchFile().

#define DEFAULT_CHUNKSIZE   (8<<20)

Definition at line 102 of file bench.c.

#define DEFAULTCOMPRESSOR   LZ4_compress

Definition at line 71 of file bench.c.

Referenced by BMK_benchFile().

#define DISPLAY (   ...)    fprintf(stderr, __VA_ARGS__)

Definition at line 127 of file bench.c.

Referenced by BMK_benchFile(), BMK_SetBlocksize(), and BMK_SetNbIterations().

#define KNUTH   2654435761U

Definition at line 100 of file bench.c.

Referenced by BMK_checksum_MMH3A().

#define MAX_MEM   (1984<<20)

Definition at line 101 of file bench.c.

Referenced by BMK_findMaxMem().

#define NBLOOPS   3

Definition at line 97 of file bench.c.

#define S32   int32_t

Definition at line 89 of file bench.c.

#define TIMELOOP   2000

Definition at line 98 of file bench.c.

Referenced by BMK_benchFile().

#define U16   uint16_t

Definition at line 87 of file bench.c.

#define U32   uint32_t

Definition at line 88 of file bench.c.

Referenced by BMK_benchFile(), and BMK_checksum_MMH3A().

#define U64   uint64_t

Definition at line 90 of file bench.c.

Referenced by BMK_benchFile(), and BMK_GetFileSize().

Function Documentation

static U32 BMK_checksum_MMH3A ( char *  buff,
U32  length 
)
static

Definition at line 198 of file bench.c.

References _rotl, KNUTH, and U32.

Referenced by BMK_benchFile().

Here is the caller graph for this function:

static size_t BMK_findMaxMem ( U64  requiredMem)
static

Definition at line 247 of file bench.c.

References MAX_MEM, and NULL.

Referenced by BMK_benchFile().

Here is the caller graph for this function:

static U64 BMK_GetFileSize ( char *  infilename)
static

Definition at line 267 of file bench.c.

References U64.

Referenced by BMK_benchFile().

Here is the caller graph for this function:

static int BMK_GetMilliSpan ( int  nTimeStart)
static

Definition at line 189 of file bench.c.

References BMK_GetMilliStart().

Referenced by BMK_benchFile().

Here is the call graph for this function:

Here is the caller graph for this function:

static int BMK_GetMilliStart ( )
static

Definition at line 175 of file bench.c.

References NULL.

Referenced by BMK_benchFile(), and BMK_GetMilliSpan().

Here is the caller graph for this function:

void BMK_SetBlocksize ( int  bsize)

Definition at line 138 of file bench.c.

References chunkSize, and DISPLAY.

Referenced by main().

Here is the caller graph for this function:

void BMK_SetNbIterations ( int  nbLoops)

Definition at line 144 of file bench.c.

References DISPLAY, and nbIterations.

Referenced by main().

Here is the caller graph for this function:

void BMK_SetPause ( )

Definition at line 150 of file bench.c.

References BMK_pause.

Referenced by main().

Here is the caller graph for this function:

Variable Documentation

int BMK_pause = 0
static

Definition at line 136 of file bench.c.

Referenced by BMK_benchFile(), and BMK_SetPause().

int chunkSize = DEFAULT_CHUNKSIZE
static

Definition at line 134 of file bench.c.

Referenced by BMK_benchFile(), BMK_SetBlocksize(), and decode_file().

int nbIterations = NBLOOPS
static

Definition at line 135 of file bench.c.

Referenced by BMK_benchFile(), and BMK_SetNbIterations().