Git Product home page Git Product logo

benchmarks's Introduction

g++ -g perf.cc -std=c++17 -isystem benchmark/include -Lbenchmark/build/src -lbenchmark -lpthread -o mybenchmark

Install needed tools apt-get install build-essential cmake git gdb

Clone markovuksanovic/benchmarks https://github.com/mvuksano/benchmarks.git

Clone google/benchmark as subfolder https://github.com/google/benchmark.git

Clone x86-simd-sort as subfolder: git clone https://github.com/intel/x86-simd-sort.git

Build: g++ -g perf.cc -std=c++17 -isystem benchmark/include -Lbenchmark/build/src -lbenchmark -lpthread -o mybenchmark

Run: ./mybenchmark --benchmark_filter=".Sum1024_x.$" --benchmark_min_time=3s --benchmark_time_unit=ms

Build targets: cmake --build build

Run sort benchmark:

./build/sort 

Example run:

markovuksanovic@instance-2:~/devel/benchmarks$ ./mybenchmark --benchmark_time_unit=us
2023-04-14T06:51:13+00:00
Running ./mybenchmark
Run on (8 X 2700 MHz CPU s)
CPU Caches:
  L1 Data 48 KiB (x4)
  L1 Instruction 32 KiB (x4)
  L2 Unified 2048 KiB (x4)
  L3 Unified 107520 KiB (x1)
Load Average: 0.22, 0.05, 0.02
---------------------------------------------------------------
Benchmark                     Time             CPU   Iterations
---------------------------------------------------------------
AvxSum256                  4.65 us         4.65 us       150657
AvxSum1024                 18.5 us         18.5 us        37761
AvxSum1024_x_1024         18931 us        18931 us           37
Avx512Sum256              0.237 us        0.237 us      2947561
Avx512Sum1024             0.285 us        0.285 us      2455984
Avx512Sum1024_x_1024        128 us          128 us         5477
Avx512Sum4096             0.476 us        0.476 us      1473410
Sum256                    0.648 us        0.648 us      1078806
Sum1024                    2.70 us         2.70 us       259042
Sum4096                    10.9 us         10.9 us        64052
Sum1024_x_1024             2822 us         2822 us          248
Sum8192                    21.9 us         21.9 us        31976

Random number generator

This program is used to generate a sequence of random numbers that can se used for benchmarking. Idea is to generate a sequence of numbers, store it into a file and use it to benchmark different scenarios.

Numnbers are stored in binary format. You tool like hexdump to view exact content. E.g.:

hexdump -e '1/8 "%016x" "\n"' nums

Build:

g++ -march=native generate_random_numbers.cc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.