CPU and I/O benchmark.
Benchmark between I/O and CPU with and without parallel computing. Read the relatory see the results.
Use the package manager APT to install general dependencies.
apt install build-essential g++
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
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.
Pull requests are welcome. Please, consider the following.
- Make sure you code have quality, a.k.a standards
- Make sure your code is secure
- Make sure your code has no performance issues
- Make sure your code is documented, if necessary
- Describe the changes that were done
No issue or PR template required, but be informative