chromium/third_party/zlib/contrib/bench/zlib_bench.cc

/*
 * Copyright 2018 The Chromium Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the Chromium source repository LICENSE file.
 *
 * A benchmark test harness for measuring decoding performance of gzip or zlib
 * (deflate) encoded compressed data. Given a file containing any data, encode
 * (compress) it into gzip or zlib format and then decode (uncompress). Output
 * the median and maximum encoding and decoding rates in MB/s.
 *
 * Raw deflate (no gzip or zlib stream wrapper) mode is also supported. Select
 * it with the [raw] argument. Use the [gzip] [zlib] arguments to select those
 * stream wrappers.
 *
 * Note this code can be compiled outside of the Chromium build system against
 * the system zlib (-lz) with g++ or clang++ as follows:
 *
 *   g++|clang++ -O3 -Wall -std=c++11 zlib_bench.cc -lstdc++ -lz
 */

#include <algorithm>
#include <chrono>
#include <fstream>
#include <memory>
#include <string>
#include <vector>

#include <memory.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

#include "zlib.h"

void error_exit(const char* error, int code) {}

inline char* string_data(std::string* s) {}

struct Data {};

Data read_file_data_or_exit(const char* name) {}

enum zlib_wrapper {};

inline int zlib_stream_wrapper_type(zlib_wrapper type) {}

const char* zlib_wrapper_name(zlib_wrapper type) {}

static int zlib_strategy =;

const char* zlib_level_strategy_name(int compression_level) {}

static int zlib_compression_level =;

void zlib_compress(
    const zlib_wrapper type,
    const char* input,
    const size_t input_size,
    std::string* output,
    bool resize_output = false)
{}

void zlib_uncompress(
    const zlib_wrapper type,
    const std::string& input,
    const size_t output_size,
    std::string* output)
{}

void verify_equal(const char* input, size_t size, std::string* output) {}

void check_file(const Data& file, zlib_wrapper type, int mode) {}

void zlib_file(const char* name,
               zlib_wrapper type,
               int width,
               int check,
               bool output_csv_format) {}

static int argn =;

char* get_option(int argc, char* argv[], const char* option) {}

bool get_compression(int argc, char* argv[], int& value) {}

void get_field_width(int argc, char* argv[], int& value) {}

void usage_exit(const char* program) {}

int main(int argc, char* argv[]) {}