Skip to content

Instantly share code, notes, and snippets.

Computer Information:
Manufacturer: Unknown
Model: Unknown
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
CPU Family: 0x6
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
#include "zbuild.h"
#include <benchmark/benchmark.h>
#define MAX_RANDOM_INTS (8192*8192 + 5)
static uint32_t *random_ints = NULL;
@KungFuJesus
KungFuJesus / adler32_benchmark.cc
Created January 11, 2022 20:14
better benchmark
#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
#include <benchmark/benchmark.h>
#include "zbuild.h"
#include "zutil.h"
extern "C" void cpu_check_features();
#include <stdint.h>
#include <stdint.h>
#include <limits.h>
#include "zbuild.h"
extern "C" {
#include "deflate.h"
}
/* benchmark_adler32.cc -- benchmark adler32 variants
* Copyright (C) 2020 Nathan Moinvaziri
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include <stdint.h>
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
@KungFuJesus
KungFuJesus / gist:24cca05e5d9283bc0d5fc74385ba5a90
Created August 24, 2022 17:26
Benchmarks zlib-dougallj vs zlib-ng (unrealistically compressible)
RUNNING: ./benchmark_zlib_apps_alt --benchmark_repetitions=10 --benchmark_display_aggregates_only=true --benchmark_filter=png_decode/ --benchmark_out=/tmp/tmpz15lkbmi
2022-08-24T13:23:32-04:00
Running ./benchmark_zlib_apps_alt
Run on (28 X 4097.68 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x14)
L1 Instruction 32 KiB (x14)
L2 Unified 1024 KiB (x14)
L3 Unified 19712 KiB (x1)
Load Average: 0.56, 0.29, 0.22
@KungFuJesus
KungFuJesus / gist:d649a1a3879b1b2823f92e442c41613c
Created August 24, 2022 17:31
Benchmarks zlib-dougallj vs zlib-ng (realistically compressible)
RUNNING: ./benchmark_zlib_apps_alt --benchmark_repetitions=10 --benchmark_display_aggregates_only=true --benchmark_filter=png_decode_re --benchmark_out=/tmp/tmpi2ugdndb
2022-08-24T13:28:49-04:00
Running ./benchmark_zlib_apps_alt
Run on (28 X 2508.39 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x14)
L1 Instruction 32 KiB (x14)
L2 Unified 1024 KiB (x14)
L3 Unified 19712 KiB (x1)
Load Average: 0.71, 0.54, 0.37
Comparing png_decode_re (from ./benchmark_zlib_apps_old) to png_decode_re (from ./benchmark_zlib_apps)
Benchmark Time CPU Time Old Time New CPU Old CPU New
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[png_decode_re vs. png_decode_re]alistic/[png_decode_re vs. png_decode_re]alistic/0_pvalue 0.0036 0.0036 U Test, Repetitions: 10 vs 10
[png_decode_re vs. png_decode_re]alistic/[png_decode_re vs. png_decode_re]alistic/0_mean -0.0063 -0.0063 9637 9576 9637 9576
[png_decode_re vs. png_decode_re]alistic/[png_decode_re vs. png_decode_re]alistic/0_median -0.0074 -0.0074 9641 9569 9640 9569
[png_decode_