wwalterr / thread

CPU and I/O benchmark w/ and w/o concurrency

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thread

CPU and I/O benchmark.

About

Benchmark between I/O and CPU with and without parallel computing. Read the relatory see the results.

Built with

Installation

Use the package manager APT to install general dependencies.

apt install build-essential g++

Usage

Compile the CPU example.

g++ cpu.cpp libraries/functions.cpp -o cpu.bin -std=c++17 -O3 -g && ./cpu.bin

Compile the CPU example using threads.

g++ cpuThread.cpp libraries/functionsThread.cpp -pthread -o cpuThread.bin -std=c++17 -O3 -g && ./cpuThread.bin

Compile the I/P example.

g++ io.cpp libraries/functions.cpp -o io.bin -std=c++17 -O3 -g && ./io.bin

Compile the I/O example using threads.

g++ ioThread.cpp libraries/functionsThread.cpp -pthread -o ioThread.bin -std=c++17 -O3 -g && ./ioThread.bin

Documentation

Use the package manager APT to install Valgrind.

apt install valgrind

Create a dynamic analysis of the CPU and I/O examples available:

valgrind --tool=callgrind ./cpu.bin # Change the binary name

Valgrind generates a calgrind.out file that can be interpreted by tools like Gprof 2 Dot (gprof2dot -f callgrind callgrind.out.* | dot -Tsvg -o output.svg and then convert from SVG to PNG) or kcache Grind.

These tools are not demonstrated here because of Python dependencies and as system dependencies, aside from converting the image file, which you can use Ink Scape (inkscape -z -e output.png input.svg). More tools

Use the script ./clean.sh to clean the assets generated by the benchmarks.

Contributing

Pull requests are welcome. Please, consider the following.

  1. Make sure you code have quality, a.k.a standards
  2. Make sure your code is secure
  3. Make sure your code has no performance issues
  4. Make sure your code is documented, if necessary
  5. Describe the changes that were done

No issue or PR template required, but be informative

License

MIT

About

CPU and I/O benchmark w/ and w/o concurrency

License:MIT License


Languages

Language:C++ 99.6%Language:Shell 0.4%